Skip to content

Commit

Permalink
Migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron-diaz committed Oct 26, 2024
1 parent 965b058 commit e767656
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
Warnings:
- You are about to drop the column `disqualified` on the `ContestantParticipation` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "ContestantParticipation" DROP COLUMN "disqualified";

-- CreateTable
CREATE TABLE "Disqualification" (
"id" TEXT NOT NULL,
"userId" TEXT NOT NULL,
"ofmiId" TEXT NOT NULL,
"reason" TEXT NOT NULL,
"appealed" BOOLEAN NOT NULL DEFAULT false,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,

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

-- CreateIndex
CREATE UNIQUE INDEX "Disqualification_userId_ofmiId_key" ON "Disqualification"("userId", "ofmiId");

-- AddForeignKey
ALTER TABLE "Disqualification" ADD CONSTRAINT "Disqualification_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "Disqualification" ADD CONSTRAINT "Disqualification_ofmiId_fkey" FOREIGN KEY ("ofmiId") REFERENCES "Ofmi"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

0 comments on commit e767656

Please sign in to comment.