daphnis/prisma/migrations/20240624150915_auth/migration.sql
2024-06-29 01:22:22 -04:00

17 lines
631 B
SQL

/*
Warnings:
- You are about to drop the column `userId` on the `session` table. All the data in the column will be lost.
- Added the required column `InvitedBy` to the `Session` table without a default value. This is not possible if the table is not empty.
*/
-- DropForeignKey
ALTER TABLE `session` DROP FOREIGN KEY `Session_userId_fkey`;
-- AlterTable
ALTER TABLE `session` DROP COLUMN `userId`,
ADD COLUMN `InvitedBy` VARCHAR(191) NOT NULL;
-- AddForeignKey
ALTER TABLE `Session` ADD CONSTRAINT `Session_InvitedBy_fkey` FOREIGN KEY (`InvitedBy`) REFERENCES `User`(`username`) ON DELETE CASCADE ON UPDATE CASCADE;