Add migration

This commit is contained in:
2026-02-02 14:52:27 +01:00
parent 3b8b3efa4a
commit 93a327c634

View File

@ -0,0 +1,65 @@
/*
Warnings:
- You are about to drop the `ArtTag` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `ArtTagAlias` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `_ArtCategoryToArtTag` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `_ArtTagToArtwork` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `_ArtworkTagsV2` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE "ArtTag" DROP CONSTRAINT "ArtTag_parentId_fkey";
-- DropForeignKey
ALTER TABLE "ArtTagAlias" DROP CONSTRAINT "ArtTagAlias_tagId_fkey";
-- DropForeignKey
ALTER TABLE "_ArtCategoryToArtTag" DROP CONSTRAINT "_ArtCategoryToArtTag_A_fkey";
-- DropForeignKey
ALTER TABLE "_ArtCategoryToArtTag" DROP CONSTRAINT "_ArtCategoryToArtTag_B_fkey";
-- DropForeignKey
ALTER TABLE "_ArtTagToArtwork" DROP CONSTRAINT "_ArtTagToArtwork_A_fkey";
-- DropForeignKey
ALTER TABLE "_ArtTagToArtwork" DROP CONSTRAINT "_ArtTagToArtwork_B_fkey";
-- DropForeignKey
ALTER TABLE "_ArtworkTagsV2" DROP CONSTRAINT "_ArtworkTagsV2_A_fkey";
-- DropForeignKey
ALTER TABLE "_ArtworkTagsV2" DROP CONSTRAINT "_ArtworkTagsV2_B_fkey";
-- DropTable
DROP TABLE "ArtTag";
-- DropTable
DROP TABLE "ArtTagAlias";
-- DropTable
DROP TABLE "_ArtCategoryToArtTag";
-- DropTable
DROP TABLE "_ArtTagToArtwork";
-- DropTable
DROP TABLE "_ArtworkTagsV2";
-- CreateTable
CREATE TABLE "_ArtworkTags" (
"A" TEXT NOT NULL,
"B" TEXT NOT NULL,
CONSTRAINT "_ArtworkTags_AB_pkey" PRIMARY KEY ("A","B")
);
-- CreateIndex
CREATE INDEX "_ArtworkTags_B_index" ON "_ArtworkTags"("B");
-- AddForeignKey
ALTER TABLE "_ArtworkTags" ADD CONSTRAINT "_ArtworkTags_A_fkey" FOREIGN KEY ("A") REFERENCES "Artwork"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "_ArtworkTags" ADD CONSTRAINT "_ArtworkTags_B_fkey" FOREIGN KEY ("B") REFERENCES "Tag"("id") ON DELETE CASCADE ON UPDATE CASCADE;