news/backend/prisma/migrations/20250409201826_update_relationships/migration.sql
2025-04-09 23:25:31 +02:00

15 lines
444 B
SQL

/*
Warnings:
- Made the column `userId` on table `Note` required. This step will fail if there are existing NULL values in that column.
*/
-- DropForeignKey
ALTER TABLE "Note" DROP CONSTRAINT "Note_userId_fkey";
-- AlterTable
ALTER TABLE "Note" ALTER COLUMN "userId" SET NOT NULL;
-- AddForeignKey
ALTER TABLE "Note" ADD CONSTRAINT "Note_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;