daphnis/prisma/migrations/20240624064448_auth/migration.sql

39 lines
2.0 KiB
MySQL
Raw Normal View History

2024-06-29 05:22:22 +00:00
/*
Warnings:
- You are about to drop the column `createdAt` on the `user` table. All the data in the column will be lost.
- You are about to drop the column `emailVerifToken` on the `user` table. All the data in the column will be lost.
- You are about to drop the column `emailVerifiedAt` on the `user` table. All the data in the column will be lost.
- You are about to drop the column `name` on the `user` table. All the data in the column will be lost.
- You are about to drop the column `password` on the `user` table. All the data in the column will be lost.
- You are about to drop the column `updatedAt` on the `user` table. All the data in the column will be lost.
- You are about to alter the column `email` on the `user` table. The data in that column could be lost. The data in that column will be cast from `VarChar(255)` to `VarChar(191)`.
- Added the required column `firstName` to the `User` table without a default value. This is not possible if the table is not empty.
- Added the required column `hashedPassword` to the `User` table without a default value. This is not possible if the table is not empty.
- Added the required column `lastName` to the `User` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE `user` DROP COLUMN `createdAt`,
DROP COLUMN `emailVerifToken`,
DROP COLUMN `emailVerifiedAt`,
DROP COLUMN `name`,
DROP COLUMN `password`,
DROP COLUMN `updatedAt`,
ADD COLUMN `firstName` VARCHAR(191) NOT NULL,
ADD COLUMN `hashedPassword` VARCHAR(191) NOT NULL,
ADD COLUMN `lastName` VARCHAR(191) NOT NULL,
MODIFY `email` VARCHAR(191) NOT NULL;
-- CreateTable
CREATE TABLE `Session` (
`id` VARCHAR(191) NOT NULL,
`expiresAt` DATETIME(3) NOT NULL,
`userId` VARCHAR(191) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- AddForeignKey
ALTER TABLE `Session` ADD CONSTRAINT `Session_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `User`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;