feat: backend storage

This commit is contained in:
charlesgauthereau
2026-01-12 21:16:57 +01:00
parent faaa4033bd
commit 67a89a12ac
2 changed files with 2080 additions and 0 deletions
@@ -0,0 +1,20 @@
CREATE TYPE "public"."provider_storage_kind" AS ENUM('local', 's3');--> statement-breakpoint
CREATE TABLE "organization_storage_channels" (
"organization_id" uuid NOT NULL,
"storage_channel_id" uuid NOT NULL,
CONSTRAINT "organization_storage_channels_organization_id_storage_channel_id_unique" UNIQUE("organization_id","storage_channel_id")
);
--> statement-breakpoint
CREATE TABLE "storage_channel" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"provider" "provider_storage_kind" NOT NULL,
"name" varchar(255) NOT NULL,
"config" jsonb NOT NULL,
"enabled" boolean DEFAULT false NOT NULL,
"updated_at" timestamp,
"created_at" timestamp DEFAULT now() NOT NULL,
"deleted_at" timestamp
);
--> statement-breakpoint
ALTER TABLE "organization_storage_channels" ADD CONSTRAINT "organization_storage_channels_organization_id_organization_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organization"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "organization_storage_channels" ADD CONSTRAINT "organization_storage_channels_storage_channel_id_storage_channel_id_fk" FOREIGN KEY ("storage_channel_id") REFERENCES "public"."storage_channel"("id") ON DELETE cascade ON UPDATE no action;
File diff suppressed because it is too large Load Diff