From a0c207b46beb4ede685ae827ee7ac79fc82ee0fa Mon Sep 17 00:00:00 2001 From: neviyn Date: Wed, 12 May 2021 17:27:27 +0100 Subject: [PATCH] IDs of data contained in migration are now hard set --- .../resources/db/migration/V1_0__Database_Init.sql | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/resources/db/migration/V1_0__Database_Init.sql b/src/main/resources/db/migration/V1_0__Database_Init.sql index f850bb7..e1261e6 100644 --- a/src/main/resources/db/migration/V1_0__Database_Init.sql +++ b/src/main/resources/db/migration/V1_0__Database_Init.sql @@ -56,17 +56,17 @@ CREATE TABLE booru.member_roles CONSTRAINT member FOREIGN KEY (member_id) REFERENCES booru.member (id) ); -CREATE SEQUENCE IF NOT EXISTS booru.member_id_seq START WITH 1 INCREMENT BY 1; +CREATE SEQUENCE IF NOT EXISTS booru.member_id_seq START WITH 2 INCREMENT BY 1; CREATE SEQUENCE IF NOT EXISTS booru.image_id_seq START WITH 1 INCREMENT BY 1; -CREATE SEQUENCE IF NOT EXISTS booru.role_id_seq START WITH 1 INCREMENT BY 1; +CREATE SEQUENCE IF NOT EXISTS booru.role_id_seq START WITH 3 INCREMENT BY 1; CREATE SEQUENCE IF NOT EXISTS booru.tag_id_seq START WITH 1 INCREMENT BY 1; -- Populate default values -INSERT INTO booru.role (name) -VALUES ('ADMIN'), - ('USER'); -INSERT INTO booru.member (name, email, password, enabled) -VALUES ('root', 'root@example.org', '$2a$10$XiMxQ1Qe.AprOdJKUPum6O2URy2b4ogffujVZVpUT8CJPksfSyNZK', TRUE); +INSERT INTO booru.role (id, name) +VALUES (1, 'ADMIN'), + (2, 'USER'); +INSERT INTO booru.member (id, name, email, password, enabled) +VALUES (1, 'root', 'root@example.org', '$2a$10$XiMxQ1Qe.AprOdJKUPum6O2URy2b4ogffujVZVpUT8CJPksfSyNZK', TRUE); INSERT INTO booru.member_roles (member_id, role_id) VALUES (1, 1), (1, 2); \ No newline at end of file