Files
parenthese/backend/prisma/migrations/20260211_003_media_items/migration.sql
T
IliesAllaliandClaude Opus 5 e8e2485dcd Parenthèse
Galaxie familiale : personnes, unions et filiations, photos, vidéos et voix sur chaque personne,
partage par lien avec consultation sans compte et contributions validées par le propriétaire.
Auto-hébergeable avec Docker. Licence PolyForm Noncommercial 1.0.0.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-14 15:49:05 +02:00

26 lines
887 B
SQL

CREATE TABLE "media_items" (
"id" TEXT NOT NULL,
"treeId" TEXT NOT NULL,
"personId" TEXT NOT NULL,
"type" TEXT NOT NULL,
"mimeType" TEXT NOT NULL,
"filePath" TEXT NOT NULL,
"thumbPath" TEXT,
"caption" TEXT,
"sizeBytes" INTEGER NOT NULL,
"displayOrder" INTEGER NOT NULL DEFAULT 1,
"isFeatured" BOOLEAN NOT NULL DEFAULT false,
"uploadedBy" TEXT,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"deletedAt" TIMESTAMP(3),
CONSTRAINT "media_items_pkey" PRIMARY KEY ("id")
);
CREATE INDEX "media_items_treeId_personId_displayOrder_idx" ON "media_items"("treeId", "personId", "displayOrder");
ALTER TABLE "media_items"
ADD CONSTRAINT "media_items_treeId_fkey"
FOREIGN KEY ("treeId") REFERENCES "trees"("id") ON DELETE CASCADE ON UPDATE CASCADE;