mirror of
https://github.com/IliesAllali/parenthese.git
synced 2026-11-06 23:32:08 +00:00
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>
26 lines
887 B
SQL
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;
|