Add create_table_public.document_authors.sql
This commit is contained in:
parent
760303a9b9
commit
a5ed859cb6
24
create_table_public.document_authors.sql
Normal file
24
create_table_public.document_authors.sql
Normal file
@ -0,0 +1,24 @@
|
||||
-- Table: public.document_authors
|
||||
|
||||
-- DROP TABLE IF EXISTS public.document_authors;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.document_authors
|
||||
(
|
||||
doc_id integer NOT NULL,
|
||||
author_id integer NOT NULL,
|
||||
CONSTRAINT document_authors_pkey PRIMARY KEY (doc_id, author_id),
|
||||
CONSTRAINT document_authors_author_id_fkey FOREIGN KEY (author_id)
|
||||
REFERENCES public.authors (author_id) MATCH SIMPLE
|
||||
ON UPDATE NO ACTION
|
||||
ON DELETE NO ACTION,
|
||||
CONSTRAINT document_authors_doc_id_fkey FOREIGN KEY (doc_id)
|
||||
REFERENCES public.documents (doc_id) MATCH SIMPLE
|
||||
ON UPDATE NO ACTION
|
||||
ON DELETE NO ACTION
|
||||
)
|
||||
|
||||
TABLESPACE pg_default;
|
||||
|
||||
ALTER TABLE IF EXISTS public.document_authors
|
||||
OWNER to dbuser01;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user