Skip to content

Commit

Permalink
Added setval to init-db
Browse files Browse the repository at this point in the history
  • Loading branch information
bilimig committed May 9, 2024
1 parent b03cb65 commit ed42f46
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 10 additions & 5 deletions Database/init-db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,21 @@ INSERT INTO users.role ("id", "name") VALUES
(1, 'User'),
(2, 'Organizer'),
(3, 'Admin');

INSERT INTO common.object_type ("id", "name") VALUES (1, 'Event'),
SELECT setval('common.address_id_seq', (SELECT MAX(id) FROM users.role));

INSERT INTO common.object_type ("id", "name") VALUES
(1, 'Event'),
(2, 'User');

SELECT setval('common.address_id_seq', (SELECT MAX(id) FROM common.object_type));

INSERT INTO common.status ("id", "name", "object_type_id") VALUES
(1, 'Interested', 2),
(2, 'Participating', 2),
(3, 'Completed', 1),
(4, 'In progress', 1),
(5, 'Waiting for approval', 1);

SELECT setval('common.address_id_seq', (SELECT MAX(id) FROM common.status));

INSERT INTO events.tag ("id", "name") VALUES
(1, 'Technologia'),
(2, 'Sport'),
Expand All @@ -176,4 +180,5 @@ INSERT INTO events.tag ("id", "name") VALUES
(7, 'Hip Hop'),
(8, 'Esport'),
(9, 'League of Legends'),
(10, 'Zdrowie');
(10, 'Zdrowie');
SELECT setval('common.address_id_seq', (SELECT MAX(id) FROM events.tag));
2 changes: 0 additions & 2 deletions Database/init-dev-data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ INSERT INTO events.participant ("id", "event_id", "user_id", "status_id") VALUES
(10, 10, 10, 2);
SELECT setval('events.participant_id_seq', (SELECT MAX(id) FROM events.participant));


INSERT INTO events.parameter ("id", "key", "value") VALUES
(1, 'Liczba Uczestników', '1000'),
(2, 'Długość Trasy', '10 km'),
Expand All @@ -78,7 +77,6 @@ INSERT INTO events.parameter ("id", "key", "value") VALUES
(9, 'Czas Trwania', '10 dni'),
(10, 'Miejsce Wydarzenia', 'Plenerowe');
SELECT setval('events.parameter_id_seq', (SELECT MAX(id) FROM events.parameter));


INSERT INTO events.event_parameter ("parameter_id", "event_id") VALUES
(1, 1),
Expand Down

0 comments on commit ed42f46

Please sign in to comment.