-- CreateTable
CREATE TABLE "ArtTagAlias" (
    "id" TEXT NOT NULL,
    "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt" TIMESTAMP(3) NOT NULL,
    "alias" TEXT NOT NULL,
    "tagId" TEXT NOT NULL,

    CONSTRAINT "ArtTagAlias_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX "ArtTagAlias_alias_key" ON "ArtTagAlias"("alias");

-- CreateIndex
CREATE INDEX "ArtTagAlias_alias_idx" ON "ArtTagAlias"("alias");

-- CreateIndex
CREATE UNIQUE INDEX "ArtTagAlias_tagId_alias_key" ON "ArtTagAlias"("tagId", "alias");

-- AddForeignKey
ALTER TABLE "ArtTagAlias" ADD CONSTRAINT "ArtTagAlias_tagId_fkey" FOREIGN KEY ("tagId") REFERENCES "ArtTag"("id") ON DELETE CASCADE ON UPDATE CASCADE;
