Added some database indices

This commit is contained in:
neviyn 2021-05-10 15:34:27 +01:00
parent 50a853d2ba
commit 03df15818e

View File

@ -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,