diff --git a/Database/init-db.sql b/Database/init-db.sql index 803121a1..8ccad54a 100644 --- a/Database/init-db.sql +++ b/Database/init-db.sql @@ -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'), @@ -176,4 +180,5 @@ INSERT INTO events.tag ("id", "name") VALUES (7, 'Hip Hop'), (8, 'Esport'), (9, 'League of Legends'), -(10, 'Zdrowie'); \ No newline at end of file +(10, 'Zdrowie'); +SELECT setval('common.address_id_seq', (SELECT MAX(id) FROM events.tag)); \ No newline at end of file diff --git a/Database/init-dev-data.sql b/Database/init-dev-data.sql index 626df0d1..e7d4dce4 100644 --- a/Database/init-dev-data.sql +++ b/Database/init-dev-data.sql @@ -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'), @@ -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),