21 lines
679 B
SQL
21 lines
679 B
SQL
-- Table: public.documents
|
|
|
|
-- DROP TABLE IF EXISTS public.documents;
|
|
|
|
CREATE TABLE IF NOT EXISTS public.documents
|
|
(
|
|
doc_id integer NOT NULL DEFAULT nextval('documents_doc_id_seq'::regclass),
|
|
title character varying(255) COLLATE pg_catalog."default" NOT NULL,
|
|
type_id integer,
|
|
created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
|
|
CONSTRAINT documents_pkey PRIMARY KEY (doc_id),
|
|
CONSTRAINT documents_type_id_fkey FOREIGN KEY (type_id)
|
|
REFERENCES public.document_types (type_id) MATCH SIMPLE
|
|
ON UPDATE NO ACTION
|
|
ON DELETE NO ACTION
|
|
)
|
|
|
|
TABLESPACE pg_default;
|
|
|
|
ALTER TABLE IF EXISTS public.documents
|
|
OWNER to dbuser01; |