Create tutorials table with constraints and drop existing table

This commit is contained in:
liosha84
2025-07-12 18:57:44 +03:00
parent f9306f7af8
commit 728ff2f313
@@ -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
)