This commit is contained in:
2026-05-12 07:54:32 +03:00
parent 0faa8b9d2d
commit d49449c30c
187 changed files with 4826 additions and 5884 deletions

View File

@@ -0,0 +1,14 @@
CREATE TYPE "public"."project_status" AS ENUM('active', 'disabled');--> statement-breakpoint
CREATE TABLE "image_projects" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"slug" text NOT NULL,
"name" text NOT NULL,
"status" "project_status" DEFAULT 'active' NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "image_assets" ADD COLUMN "project_id" uuid;--> statement-breakpoint
CREATE UNIQUE INDEX "image_projects_slug_idx" ON "image_projects" USING btree ("slug");--> statement-breakpoint
ALTER TABLE "image_assets" ADD CONSTRAINT "image_assets_project_id_image_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."image_projects"("id") ON DELETE restrict ON UPDATE no action;--> statement-breakpoint
CREATE INDEX "image_assets_project_id_idx" ON "image_assets" USING btree ("project_id");