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 8, 2024
1 parent 8742a30 commit ce3e943
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 9 additions & 4 deletions Database/init-db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,19 @@ INSERT INTO users.role ("id", "name") VALUES
(1, 'User'),
(2, 'Organiser'),
(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, 'Zainteresoway', 2),
(2, 'Wezmę udział', 2),
(3, 'Zrealizowano', 1),
(4, 'W trakcie realizacji', 1);
SELECT setval('common.address_id_seq', (SELECT MAX(id) FROM common.status));

INSERT INTO events.tag ("id", "name") VALUES
(1, 'Technologia'),
Expand All @@ -170,4 +174,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 ce3e943

Please sign in to comment.