Add create_table_public.document_authors.sql
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user