CREATE TABLE IF NOT EXISTS api.streams_vtuber_links ( id integer NOT NULL, stream_id integer, vtuber_id integer, stream_order double precision, CONSTRAINT streams_vtuber_links_pkey PRIMARY KEY (id), CONSTRAINT streams_vtuber_links_unique UNIQUE (stream_id, vtuber_id), CONSTRAINT streams_vtuber_links_fk FOREIGN KEY (stream_id) REFERENCES api.streams (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT streams_vtuber_links_inv_fk FOREIGN KEY (vtuber_id) REFERENCES api.vtubers (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE CASCADE ) TABLESPACE pg_default; ALTER TABLE IF EXISTS api.streams_vtuber_links OWNER to postgres; -- Index: streams_vtuber_links_fk -- DROP INDEX IF EXISTS api.streams_vtuber_links_fk; CREATE INDEX IF NOT EXISTS streams_vtuber_links_fk ON api.streams_vtuber_links USING btree (stream_id ASC NULLS LAST) TABLESPACE pg_default; -- Index: streams_vtuber_links_inv_fk -- DROP INDEX IF EXISTS api.streams_vtuber_links_inv_fk; CREATE INDEX IF NOT EXISTS streams_vtuber_links_inv_fk ON api.streams_vtuber_links USING btree (vtuber_id ASC NULLS LAST) TABLESPACE pg_default; -- Index: streams_vtuber_links_order_inv_fk -- DROP INDEX IF EXISTS api.streams_vtuber_links_order_inv_fk; CREATE INDEX IF NOT EXISTS streams_vtuber_links_order_inv_fk ON api.streams_vtuber_links USING btree (stream_order ASC NULLS LAST) TABLESPACE pg_default;