chore(prisma): apply migration to remove TEACHER and STUDENT roles

This commit is contained in:
cfngc4594 2025-03-21 11:14:24 +08:00
parent 190431ece6
commit 3fefee674b
2 changed files with 17 additions and 1 deletions

View File

@ -0,0 +1,16 @@
/*
Warnings:
- The values [TEACHER,STUDENT] on the enum `Role` will be removed. If these variants are still used in the database, this will fail.
*/
-- AlterEnum
BEGIN;
CREATE TYPE "Role_new" AS ENUM ('ADMIN', 'GUEST');
ALTER TABLE "User" ALTER COLUMN "role" DROP DEFAULT;
ALTER TABLE "User" ALTER COLUMN "role" TYPE "Role_new" USING ("role"::text::"Role_new");
ALTER TYPE "Role" RENAME TO "Role_old";
ALTER TYPE "Role_new" RENAME TO "Role";
DROP TYPE "Role_old";
ALTER TABLE "User" ALTER COLUMN "role" SET DEFAULT 'GUEST';
COMMIT;

View File

@ -484,7 +484,7 @@ public:
name: "fly6516",
email: "fly6516@outlook.com",
password: "$2b$10$SD1T/dYvKTArGdTmf8ERxuBKIONxY01/wSboRNaNsHnKZzDhps/0u",
role: "TEACHER",
role: "ADMIN",
problems: {
create: [
{