Files
laca-website/backend/prisma/migrations/20250321094407_fix_vote_tb/migration.sql

20 lines
670 B
SQL

/*
Warnings:
- You are about to drop the column `commentId` on the `Vote` table. All the data in the column will be lost.
- Added the required column `slot_id` to the `Vote` table without a default value. This is not possible if the table is not empty.
*/
-- DropForeignKey
ALTER TABLE "Vote" DROP CONSTRAINT "Vote_commentId_fkey";
-- AlterTable
ALTER TABLE "User" ALTER COLUMN "email" DROP NOT NULL;
-- AlterTable
ALTER TABLE "Vote" DROP COLUMN "commentId",
ADD COLUMN "slot_id" INTEGER NOT NULL;
-- AddForeignKey
ALTER TABLE "Vote" ADD CONSTRAINT "Vote_slot_id_fkey" FOREIGN KEY ("slot_id") REFERENCES "Slot"("id") ON DELETE RESTRICT ON UPDATE CASCADE;