Enhance tutorial management with user-specific features and improve error handling

This commit is contained in:
liosha84
2025-07-08 20:36:37 +03:00
parent ec1581e88a
commit b37f62e59b
13 changed files with 259 additions and 29 deletions
@@ -0,0 +1,27 @@
DROP TABLE IF EXISTS public.tutorials;
CREATE TABLE IF NOT EXISTS public.tutorials
(
description character varying(255) COLLATE pg_catalog."default",
published boolean,
title character varying(255) COLLATE pg_catalog."default",
id bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 9223372036854775807 CACHE 1 ),
userid bigint,
CONSTRAINT "tutorial_user_FK" FOREIGN KEY (userid)
REFERENCES public.users (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
NOT VALID
)
TABLESPACE pg_default;
-- Index: fki_tutorial_user_FK
-- DROP INDEX IF EXISTS public."fki_tutorial_user_FK";
CREATE INDEX IF NOT EXISTS "fki_tutorial_user_FK"
ON public.tutorials USING btree
(userid ASC NULLS LAST)
TABLESPACE pg_default;