From 728ff2f313932f62a844a0af0e6bb40ada5b6cf5 Mon Sep 17 00:00:00 2001 From: liosha84 <138026690+liosha84@users.noreply.github.com> Date: Sat, 12 Jul 2025 18:57:44 +0300 Subject: [PATCH] Create tutorials table with constraints and drop existing table --- .../db/migration/V8__tutorial_remake.sql | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/main/resources/db/migration/V8__tutorial_remake.sql diff --git a/src/main/resources/db/migration/V8__tutorial_remake.sql b/src/main/resources/db/migration/V8__tutorial_remake.sql new file mode 100644 index 0000000..3c476c6 --- /dev/null +++ b/src/main/resources/db/migration/V8__tutorial_remake.sql @@ -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 +) +