-- 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;
    