Working sorting kinda?

This commit is contained in:
2025-07-26 19:00:19 +02:00
parent 3c0e191cd9
commit ef281ef70f
21 changed files with 586 additions and 169 deletions

View File

@ -0,0 +1,32 @@
/*
Warnings:
- You are about to drop the `ImageSortContext` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE "ImageSortContext" DROP CONSTRAINT "ImageSortContext_imageId_fkey";
-- DropTable
DROP TABLE "ImageSortContext";
-- CreateTable
CREATE TABLE "PortfolioSortContext" (
"id" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"key" TEXT NOT NULL,
"index" INTEGER NOT NULL,
"imageId" TEXT NOT NULL,
CONSTRAINT "PortfolioSortContext_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE INDEX "PortfolioSortContext_key_index_idx" ON "PortfolioSortContext"("key", "index");
-- CreateIndex
CREATE UNIQUE INDEX "PortfolioSortContext_key_imageId_key" ON "PortfolioSortContext"("key", "imageId");
-- AddForeignKey
ALTER TABLE "PortfolioSortContext" ADD CONSTRAINT "PortfolioSortContext_imageId_fkey" FOREIGN KEY ("imageId") REFERENCES "PortfolioImage"("id") ON DELETE RESTRICT ON UPDATE CASCADE;