5c424a2c6d
* feat: thumbnails workers * feat: thumbnails final * fix: no thumbnailId * fix: unecessary stuff
16 lines
496 B
SQL
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;
|