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 1dce03a..f850bb7 100644 --- a/src/main/resources/db/migration/V1_0__Database_Init.sql +++ b/src/main/resources/db/migration/V1_0__Database_Init.sql @@ -19,6 +19,8 @@ CREATE TABLE booru.image CONSTRAINT uploader FOREIGN KEY (uploader) REFERENCES booru.member (id) ); +CREATE UNIQUE INDEX image_pk_index ON booru.image(id); + CREATE TABLE booru.role ( id bigserial NOT NULL PRIMARY KEY, @@ -32,6 +34,8 @@ CREATE TABLE booru.tag amount bigint NOT NULL ); +CREATE UNIQUE INDEX tag_pk_index ON booru.tag(id); + CREATE TABLE booru.tag_image ( tag_id bigint NOT NULL, @@ -41,6 +45,9 @@ CREATE TABLE booru.tag_image CONSTRAINT tag FOREIGN KEY (tag_id) REFERENCES booru.tag (id) ); +CREATE INDEX ti_image_index ON booru.tag_image(image_id); +CREATE INDEX ti_tag_index ON booru.tag_image(tag_id); + CREATE TABLE booru.member_roles ( member_id bigint NOT NULL,