stacker.news/prisma/migrations/20230927194433_mute/migration.sql

19 lines
703 B
MySQL
Raw Normal View History

2023-09-28 20:02:25 +00:00
-- CreateTable
CREATE TABLE "Mute" (
"muterId" INTEGER NOT NULL,
"mutedId" INTEGER NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "Mute_pkey" PRIMARY KEY ("muterId","mutedId")
);
-- CreateIndex
CREATE INDEX "Mute_mutedId_muterId_idx" ON "Mute"("mutedId", "muterId");
-- AddForeignKey
ALTER TABLE "Mute" ADD CONSTRAINT "Mute_muterId_fkey" FOREIGN KEY ("muterId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Mute" ADD CONSTRAINT "Mute_mutedId_fkey" FOREIGN KEY ("mutedId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;