zipline/prisma/migrations/20230523025656_thumbnails/migration.sql
dicedtomato 5c424a2c6d
feat: video thumbnails (#413) (#376)
* feat: thumbnails workers

* feat: thumbnails final

* fix: no thumbnailId

* fix: unecessary stuff
2023-05-29 19:02:18 -07:00

16 lines
496 B
SQL

-- CreateTable
CREATE TABLE "Thumbnail" (
"id" SERIAL NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"name" TEXT NOT NULL,
"fileId" INTEGER NOT NULL,
CONSTRAINT "Thumbnail_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "Thumbnail_fileId_key" ON "Thumbnail"("fileId");
-- AddForeignKey
ALTER TABLE "Thumbnail" ADD CONSTRAINT "Thumbnail_fileId_fkey" FOREIGN KEY ("fileId") REFERENCES "File"("id") ON DELETE CASCADE ON UPDATE CASCADE;