Files
editor/supabase/migrations/20260226002554_big_pestilence.sql
T

14 lines
633 B
SQL

CREATE TABLE "project_assets" (
"id" text PRIMARY KEY NOT NULL,
"project_id" text NOT NULL,
"storage_key" text NOT NULL,
"url" text NOT NULL,
"type" text NOT NULL,
"original_name" text,
"mime_type" text,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "project_assets" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
ALTER TABLE "project_assets" ADD CONSTRAINT "project_assets_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE cascade ON UPDATE no action;