Create tutorials table with constraints and drop existing table
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
DROP TABLE tutorials;
|
||||
|
||||
CREATE TABLE tutorials
|
||||
(
|
||||
id bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 9223372036854775807 CACHE 1 ),
|
||||
published boolean,
|
||||
title character varying(255) COLLATE pg_catalog."default",
|
||||
userid bigint,
|
||||
created timestamp with time zone,
|
||||
modified timestamp with time zone,
|
||||
description character varying(255) COLLATE pg_catalog."default",
|
||||
CONSTRAINT tutorials_title_key UNIQUE (title),
|
||||
CONSTRAINT "tutorial_user_FK" FOREIGN KEY (userid)
|
||||
REFERENCES public.users (id) MATCH SIMPLE
|
||||
ON UPDATE NO ACTION
|
||||
ON DELETE NO ACTION
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user