19 lines
703 B
MySQL
19 lines
703 B
MySQL
|
-- 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;
|