37 lines
1.0 KiB
MySQL
37 lines
1.0 KiB
MySQL
|
-- Table: api.vods_uploader_links
|
||
|
|
||
|
-- DROP TABLE IF EXISTS api.vods_uploader_links;
|
||
|
|
||
|
CREATE TABLE IF NOT EXISTS api.vods_uploader_links
|
||
|
(
|
||
|
id integer NOT NULL,
|
||
|
vod_id integer,
|
||
|
user_id integer,
|
||
|
CONSTRAINT vods_uploader_links_pkey PRIMARY KEY (id),
|
||
|
CONSTRAINT vods_uploader_links_unique UNIQUE (vod_id, user_id),
|
||
|
CONSTRAINT vods_uploader_links_fk FOREIGN KEY (vod_id)
|
||
|
REFERENCES api.vods (id) MATCH SIMPLE
|
||
|
ON UPDATE NO ACTION
|
||
|
ON DELETE CASCADE
|
||
|
)
|
||
|
|
||
|
TABLESPACE pg_default;
|
||
|
|
||
|
ALTER TABLE IF EXISTS api.vods_uploader_links
|
||
|
OWNER to postgres;
|
||
|
-- Index: vods_uploader_links_fk
|
||
|
|
||
|
-- DROP INDEX IF EXISTS api.vods_uploader_links_fk;
|
||
|
|
||
|
CREATE INDEX IF NOT EXISTS vods_uploader_links_fk
|
||
|
ON api.vods_uploader_links USING btree
|
||
|
(vod_id ASC NULLS LAST)
|
||
|
TABLESPACE pg_default;
|
||
|
-- Index: vods_uploader_links_inv_fk
|
||
|
|
||
|
-- DROP INDEX IF EXISTS api.vods_uploader_links_inv_fk;
|
||
|
|
||
|
CREATE INDEX IF NOT EXISTS vods_uploader_links_inv_fk
|
||
|
ON api.vods_uploader_links USING btree
|
||
|
(user_id ASC NULLS LAST)
|
||
|
TABLESPACE pg_default;
|