Add create_table_public.documents.sql
This commit is contained in:
parent
cd22cb185d
commit
84a14382a3
21
create_table_public.documents.sql
Normal file
21
create_table_public.documents.sql
Normal file
@ -0,0 +1,21 @@
|
||||
-- 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;
|
||||
Loading…
x
Reference in New Issue
Block a user