REFACTORED - Replace Prisma with Drizzle ORM
CI / quality (push) Waiting to run

- Add lib/db (schema, postgres.js client, enums, seed, migrations) on Drizzle
- Rewrite all lib and admin action queries from Prisma to Drizzle
- Keep existing table/column names so no data migration is needed
- Preserve signed-cookie admin auth unchanged
- Map unique-violation handling from Prisma P2002 to SQLSTATE 23505
- Swap deps, scripts, Makefile, and Dockerfile from Prisma to Drizzle
This commit is contained in:
Moh
2026-08-08 02:09:03 +02:00
parent 0f48381894
commit ba63f75ea8
38 changed files with 3964 additions and 2520 deletions
@@ -0,0 +1,125 @@
CREATE TYPE "public"."MediaKind" AS ENUM('IMAGE', 'DOCUMENT');--> statement-breakpoint
CREATE TYPE "public"."MediaSource" AS ENUM('UPLOAD', 'EXTERNAL');--> statement-breakpoint
CREATE TYPE "public"."MediaUsageType" AS ENUM('PORTFOLIO_COVER', 'PORTFOLIO_SECTION', 'PORTFOLIO_ASSET', 'GENERIC');--> statement-breakpoint
CREATE TYPE "public"."PortfolioAssetKind" AS ENUM('IMAGE', 'DOCUMENT');--> statement-breakpoint
CREATE TYPE "public"."PortfolioProjectViewMode" AS ENUM('GRID', 'STORY', 'CASE_STUDY');--> statement-breakpoint
CREATE TYPE "public"."PortfolioSectionType" AS ENUM('RICH_TEXT', 'GALLERY', 'STATS', 'DELIVERABLES', 'LINK');--> statement-breakpoint
CREATE TABLE "AppConfig" (
"id" text PRIMARY KEY NOT NULL,
"key" text NOT NULL,
"value" text NOT NULL,
"createdAt" timestamp (3) DEFAULT now() NOT NULL,
"updatedAt" timestamp (3) DEFAULT now() NOT NULL,
CONSTRAINT "AppConfig_key_unique" UNIQUE("key")
);
--> statement-breakpoint
CREATE TABLE "Category" (
"id" text PRIMARY KEY NOT NULL,
"slug" text NOT NULL,
"nameAr" text NOT NULL,
"nameEn" text NOT NULL,
"nameDe" text NOT NULL,
"descriptionAr" text NOT NULL,
"descriptionEn" text NOT NULL,
"descriptionDe" text NOT NULL,
"sortOrder" integer DEFAULT 0 NOT NULL,
"isActive" boolean DEFAULT true NOT NULL,
"createdAt" timestamp (3) DEFAULT now() NOT NULL,
"updatedAt" timestamp (3) DEFAULT now() NOT NULL,
CONSTRAINT "Category_slug_unique" UNIQUE("slug")
);
--> statement-breakpoint
CREATE TABLE "MediaAsset" (
"id" text PRIMARY KEY NOT NULL,
"source" "MediaSource" NOT NULL,
"kind" "MediaKind" NOT NULL,
"url" text NOT NULL,
"fileName" text NOT NULL,
"label" text NOT NULL,
"altText" text,
"mimeType" text,
"size" integer,
"createdAt" timestamp (3) DEFAULT now() NOT NULL,
"updatedAt" timestamp (3) DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE TABLE "MediaUsage" (
"id" text PRIMARY KEY NOT NULL,
"assetId" text NOT NULL,
"usageType" "MediaUsageType" NOT NULL,
"entityType" text NOT NULL,
"entityId" text NOT NULL,
"fieldKey" text NOT NULL,
"createdAt" timestamp (3) DEFAULT now() NOT NULL,
"updatedAt" timestamp (3) DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE TABLE "PortfolioAsset" (
"id" text PRIMARY KEY NOT NULL,
"projectId" text NOT NULL,
"kind" "PortfolioAssetKind" NOT NULL,
"filePath" text NOT NULL,
"altAr" text NOT NULL,
"altEn" text NOT NULL,
"altDe" text NOT NULL,
"sortOrder" integer DEFAULT 0 NOT NULL,
"createdAt" timestamp (3) DEFAULT now() NOT NULL,
"updatedAt" timestamp (3) DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE TABLE "PortfolioProject" (
"id" text PRIMARY KEY NOT NULL,
"categoryId" text NOT NULL,
"slug" text NOT NULL,
"viewMode" "PortfolioProjectViewMode" DEFAULT 'GRID' NOT NULL,
"titleAr" text NOT NULL,
"titleEn" text NOT NULL,
"titleDe" text NOT NULL,
"summaryAr" text NOT NULL,
"summaryEn" text NOT NULL,
"summaryDe" text NOT NULL,
"clientName" text NOT NULL,
"projectYear" integer NOT NULL,
"serviceLabelAr" text NOT NULL,
"serviceLabelEn" text NOT NULL,
"serviceLabelDe" text NOT NULL,
"previewUrl" text,
"coverImagePath" text,
"isFeatured" boolean DEFAULT false NOT NULL,
"isPublished" boolean DEFAULT false NOT NULL,
"publishedAt" timestamp (3),
"sortOrder" integer DEFAULT 0 NOT NULL,
"createdAt" timestamp (3) DEFAULT now() NOT NULL,
"updatedAt" timestamp (3) DEFAULT now() NOT NULL,
CONSTRAINT "PortfolioProject_slug_unique" UNIQUE("slug")
);
--> statement-breakpoint
CREATE TABLE "PortfolioSection" (
"id" text PRIMARY KEY NOT NULL,
"projectId" text NOT NULL,
"type" "PortfolioSectionType" NOT NULL,
"titleAr" text NOT NULL,
"titleEn" text NOT NULL,
"titleDe" text NOT NULL,
"bodyAr" text NOT NULL,
"bodyEn" text NOT NULL,
"bodyDe" text NOT NULL,
"imagePath" text,
"linkUrl" text,
"sortOrder" integer DEFAULT 0 NOT NULL,
"createdAt" timestamp (3) DEFAULT now() NOT NULL,
"updatedAt" timestamp (3) DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "MediaUsage" ADD CONSTRAINT "MediaUsage_assetId_MediaAsset_id_fk" FOREIGN KEY ("assetId") REFERENCES "public"."MediaAsset"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "PortfolioAsset" ADD CONSTRAINT "PortfolioAsset_projectId_PortfolioProject_id_fk" FOREIGN KEY ("projectId") REFERENCES "public"."PortfolioProject"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "PortfolioProject" ADD CONSTRAINT "PortfolioProject_categoryId_Category_id_fk" FOREIGN KEY ("categoryId") REFERENCES "public"."Category"("id") ON DELETE restrict ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "PortfolioSection" ADD CONSTRAINT "PortfolioSection_projectId_PortfolioProject_id_fk" FOREIGN KEY ("projectId") REFERENCES "public"."PortfolioProject"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
CREATE INDEX "MediaAsset_kind_createdAt_idx" ON "MediaAsset" USING btree ("kind","createdAt");--> statement-breakpoint
CREATE UNIQUE INDEX "MediaUsage_usageType_entityType_entityId_fieldKey_key" ON "MediaUsage" USING btree ("usageType","entityType","entityId","fieldKey");--> statement-breakpoint
CREATE INDEX "MediaUsage_assetId_idx" ON "MediaUsage" USING btree ("assetId");--> statement-breakpoint
CREATE INDEX "MediaUsage_entityType_entityId_idx" ON "MediaUsage" USING btree ("entityType","entityId");--> statement-breakpoint
CREATE INDEX "PortfolioAsset_projectId_sortOrder_idx" ON "PortfolioAsset" USING btree ("projectId","sortOrder");--> statement-breakpoint
CREATE INDEX "PortfolioProject_categoryId_isPublished_sortOrder_idx" ON "PortfolioProject" USING btree ("categoryId","isPublished","sortOrder");--> statement-breakpoint
CREATE INDEX "PortfolioProject_isPublished_sortOrder_idx" ON "PortfolioProject" USING btree ("isPublished","sortOrder");--> statement-breakpoint
CREATE INDEX "PortfolioSection_projectId_sortOrder_idx" ON "PortfolioSection" USING btree ("projectId","sortOrder");
+956
View File
@@ -0,0 +1,956 @@
{
"id": "d0f97c12-4a3b-4cf7-8f81-3d00571737f4",
"prevId": "00000000-0000-0000-0000-000000000000",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.AppConfig": {
"name": "AppConfig",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"key": {
"name": "key",
"type": "text",
"primaryKey": false,
"notNull": true
},
"value": {
"name": "value",
"type": "text",
"primaryKey": false,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp (3)",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp (3)",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"AppConfig_key_unique": {
"name": "AppConfig_key_unique",
"nullsNotDistinct": false,
"columns": [
"key"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.Category": {
"name": "Category",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"slug": {
"name": "slug",
"type": "text",
"primaryKey": false,
"notNull": true
},
"nameAr": {
"name": "nameAr",
"type": "text",
"primaryKey": false,
"notNull": true
},
"nameEn": {
"name": "nameEn",
"type": "text",
"primaryKey": false,
"notNull": true
},
"nameDe": {
"name": "nameDe",
"type": "text",
"primaryKey": false,
"notNull": true
},
"descriptionAr": {
"name": "descriptionAr",
"type": "text",
"primaryKey": false,
"notNull": true
},
"descriptionEn": {
"name": "descriptionEn",
"type": "text",
"primaryKey": false,
"notNull": true
},
"descriptionDe": {
"name": "descriptionDe",
"type": "text",
"primaryKey": false,
"notNull": true
},
"sortOrder": {
"name": "sortOrder",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"isActive": {
"name": "isActive",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp (3)",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp (3)",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"Category_slug_unique": {
"name": "Category_slug_unique",
"nullsNotDistinct": false,
"columns": [
"slug"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.MediaAsset": {
"name": "MediaAsset",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"source": {
"name": "source",
"type": "MediaSource",
"typeSchema": "public",
"primaryKey": false,
"notNull": true
},
"kind": {
"name": "kind",
"type": "MediaKind",
"typeSchema": "public",
"primaryKey": false,
"notNull": true
},
"url": {
"name": "url",
"type": "text",
"primaryKey": false,
"notNull": true
},
"fileName": {
"name": "fileName",
"type": "text",
"primaryKey": false,
"notNull": true
},
"label": {
"name": "label",
"type": "text",
"primaryKey": false,
"notNull": true
},
"altText": {
"name": "altText",
"type": "text",
"primaryKey": false,
"notNull": false
},
"mimeType": {
"name": "mimeType",
"type": "text",
"primaryKey": false,
"notNull": false
},
"size": {
"name": "size",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"createdAt": {
"name": "createdAt",
"type": "timestamp (3)",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp (3)",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"MediaAsset_kind_createdAt_idx": {
"name": "MediaAsset_kind_createdAt_idx",
"columns": [
{
"expression": "kind",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "createdAt",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.MediaUsage": {
"name": "MediaUsage",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"assetId": {
"name": "assetId",
"type": "text",
"primaryKey": false,
"notNull": true
},
"usageType": {
"name": "usageType",
"type": "MediaUsageType",
"typeSchema": "public",
"primaryKey": false,
"notNull": true
},
"entityType": {
"name": "entityType",
"type": "text",
"primaryKey": false,
"notNull": true
},
"entityId": {
"name": "entityId",
"type": "text",
"primaryKey": false,
"notNull": true
},
"fieldKey": {
"name": "fieldKey",
"type": "text",
"primaryKey": false,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp (3)",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp (3)",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"MediaUsage_usageType_entityType_entityId_fieldKey_key": {
"name": "MediaUsage_usageType_entityType_entityId_fieldKey_key",
"columns": [
{
"expression": "usageType",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "entityType",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "entityId",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "fieldKey",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": true,
"concurrently": false,
"method": "btree",
"with": {}
},
"MediaUsage_assetId_idx": {
"name": "MediaUsage_assetId_idx",
"columns": [
{
"expression": "assetId",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"MediaUsage_entityType_entityId_idx": {
"name": "MediaUsage_entityType_entityId_idx",
"columns": [
{
"expression": "entityType",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "entityId",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"MediaUsage_assetId_MediaAsset_id_fk": {
"name": "MediaUsage_assetId_MediaAsset_id_fk",
"tableFrom": "MediaUsage",
"tableTo": "MediaAsset",
"columnsFrom": [
"assetId"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.PortfolioAsset": {
"name": "PortfolioAsset",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"projectId": {
"name": "projectId",
"type": "text",
"primaryKey": false,
"notNull": true
},
"kind": {
"name": "kind",
"type": "PortfolioAssetKind",
"typeSchema": "public",
"primaryKey": false,
"notNull": true
},
"filePath": {
"name": "filePath",
"type": "text",
"primaryKey": false,
"notNull": true
},
"altAr": {
"name": "altAr",
"type": "text",
"primaryKey": false,
"notNull": true
},
"altEn": {
"name": "altEn",
"type": "text",
"primaryKey": false,
"notNull": true
},
"altDe": {
"name": "altDe",
"type": "text",
"primaryKey": false,
"notNull": true
},
"sortOrder": {
"name": "sortOrder",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"createdAt": {
"name": "createdAt",
"type": "timestamp (3)",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp (3)",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"PortfolioAsset_projectId_sortOrder_idx": {
"name": "PortfolioAsset_projectId_sortOrder_idx",
"columns": [
{
"expression": "projectId",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "sortOrder",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"PortfolioAsset_projectId_PortfolioProject_id_fk": {
"name": "PortfolioAsset_projectId_PortfolioProject_id_fk",
"tableFrom": "PortfolioAsset",
"tableTo": "PortfolioProject",
"columnsFrom": [
"projectId"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.PortfolioProject": {
"name": "PortfolioProject",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"categoryId": {
"name": "categoryId",
"type": "text",
"primaryKey": false,
"notNull": true
},
"slug": {
"name": "slug",
"type": "text",
"primaryKey": false,
"notNull": true
},
"viewMode": {
"name": "viewMode",
"type": "PortfolioProjectViewMode",
"typeSchema": "public",
"primaryKey": false,
"notNull": true,
"default": "'GRID'"
},
"titleAr": {
"name": "titleAr",
"type": "text",
"primaryKey": false,
"notNull": true
},
"titleEn": {
"name": "titleEn",
"type": "text",
"primaryKey": false,
"notNull": true
},
"titleDe": {
"name": "titleDe",
"type": "text",
"primaryKey": false,
"notNull": true
},
"summaryAr": {
"name": "summaryAr",
"type": "text",
"primaryKey": false,
"notNull": true
},
"summaryEn": {
"name": "summaryEn",
"type": "text",
"primaryKey": false,
"notNull": true
},
"summaryDe": {
"name": "summaryDe",
"type": "text",
"primaryKey": false,
"notNull": true
},
"clientName": {
"name": "clientName",
"type": "text",
"primaryKey": false,
"notNull": true
},
"projectYear": {
"name": "projectYear",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"serviceLabelAr": {
"name": "serviceLabelAr",
"type": "text",
"primaryKey": false,
"notNull": true
},
"serviceLabelEn": {
"name": "serviceLabelEn",
"type": "text",
"primaryKey": false,
"notNull": true
},
"serviceLabelDe": {
"name": "serviceLabelDe",
"type": "text",
"primaryKey": false,
"notNull": true
},
"previewUrl": {
"name": "previewUrl",
"type": "text",
"primaryKey": false,
"notNull": false
},
"coverImagePath": {
"name": "coverImagePath",
"type": "text",
"primaryKey": false,
"notNull": false
},
"isFeatured": {
"name": "isFeatured",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"isPublished": {
"name": "isPublished",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"publishedAt": {
"name": "publishedAt",
"type": "timestamp (3)",
"primaryKey": false,
"notNull": false
},
"sortOrder": {
"name": "sortOrder",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"createdAt": {
"name": "createdAt",
"type": "timestamp (3)",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp (3)",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"PortfolioProject_categoryId_isPublished_sortOrder_idx": {
"name": "PortfolioProject_categoryId_isPublished_sortOrder_idx",
"columns": [
{
"expression": "categoryId",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "isPublished",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "sortOrder",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"PortfolioProject_isPublished_sortOrder_idx": {
"name": "PortfolioProject_isPublished_sortOrder_idx",
"columns": [
{
"expression": "isPublished",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "sortOrder",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"PortfolioProject_categoryId_Category_id_fk": {
"name": "PortfolioProject_categoryId_Category_id_fk",
"tableFrom": "PortfolioProject",
"tableTo": "Category",
"columnsFrom": [
"categoryId"
],
"columnsTo": [
"id"
],
"onDelete": "restrict",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"PortfolioProject_slug_unique": {
"name": "PortfolioProject_slug_unique",
"nullsNotDistinct": false,
"columns": [
"slug"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.PortfolioSection": {
"name": "PortfolioSection",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"projectId": {
"name": "projectId",
"type": "text",
"primaryKey": false,
"notNull": true
},
"type": {
"name": "type",
"type": "PortfolioSectionType",
"typeSchema": "public",
"primaryKey": false,
"notNull": true
},
"titleAr": {
"name": "titleAr",
"type": "text",
"primaryKey": false,
"notNull": true
},
"titleEn": {
"name": "titleEn",
"type": "text",
"primaryKey": false,
"notNull": true
},
"titleDe": {
"name": "titleDe",
"type": "text",
"primaryKey": false,
"notNull": true
},
"bodyAr": {
"name": "bodyAr",
"type": "text",
"primaryKey": false,
"notNull": true
},
"bodyEn": {
"name": "bodyEn",
"type": "text",
"primaryKey": false,
"notNull": true
},
"bodyDe": {
"name": "bodyDe",
"type": "text",
"primaryKey": false,
"notNull": true
},
"imagePath": {
"name": "imagePath",
"type": "text",
"primaryKey": false,
"notNull": false
},
"linkUrl": {
"name": "linkUrl",
"type": "text",
"primaryKey": false,
"notNull": false
},
"sortOrder": {
"name": "sortOrder",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"createdAt": {
"name": "createdAt",
"type": "timestamp (3)",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp (3)",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"PortfolioSection_projectId_sortOrder_idx": {
"name": "PortfolioSection_projectId_sortOrder_idx",
"columns": [
{
"expression": "projectId",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "sortOrder",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"PortfolioSection_projectId_PortfolioProject_id_fk": {
"name": "PortfolioSection_projectId_PortfolioProject_id_fk",
"tableFrom": "PortfolioSection",
"tableTo": "PortfolioProject",
"columnsFrom": [
"projectId"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
}
},
"enums": {
"public.MediaKind": {
"name": "MediaKind",
"schema": "public",
"values": [
"IMAGE",
"DOCUMENT"
]
},
"public.MediaSource": {
"name": "MediaSource",
"schema": "public",
"values": [
"UPLOAD",
"EXTERNAL"
]
},
"public.MediaUsageType": {
"name": "MediaUsageType",
"schema": "public",
"values": [
"PORTFOLIO_COVER",
"PORTFOLIO_SECTION",
"PORTFOLIO_ASSET",
"GENERIC"
]
},
"public.PortfolioAssetKind": {
"name": "PortfolioAssetKind",
"schema": "public",
"values": [
"IMAGE",
"DOCUMENT"
]
},
"public.PortfolioProjectViewMode": {
"name": "PortfolioProjectViewMode",
"schema": "public",
"values": [
"GRID",
"STORY",
"CASE_STUDY"
]
},
"public.PortfolioSectionType": {
"name": "PortfolioSectionType",
"schema": "public",
"values": [
"RICH_TEXT",
"GALLERY",
"STATS",
"DELIVERABLES",
"LINK"
]
}
},
"schemas": {},
"sequences": {},
"roles": {},
"policies": {},
"views": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}
+13
View File
@@ -0,0 +1,13 @@
{
"version": "7",
"dialect": "postgresql",
"entries": [
{
"idx": 0,
"version": "7",
"when": 1786146995564,
"tag": "0000_absurd_rawhide_kid",
"breakpoints": true
}
]
}