fix: Adds password into User schema.
This commit is contained in:
parent
dfc258bde6
commit
6d0fc93138
2 changed files with 23 additions and 0 deletions
21
prisma/migrations/20240417153312_fix_add_pw/migration.sql
Normal file
21
prisma/migrations/20240417153312_fix_add_pw/migration.sql
Normal file
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
Warnings:
|
||||
|
||||
- Added the required column `password` to the `User` table without a default value. This is not possible if the table is not empty.
|
||||
|
||||
*/
|
||||
-- RedefineTables
|
||||
PRAGMA foreign_keys=OFF;
|
||||
CREATE TABLE "new_User" (
|
||||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
"email" TEXT NOT NULL,
|
||||
"name" TEXT,
|
||||
"password" TEXT NOT NULL,
|
||||
"rootToken" TEXT
|
||||
);
|
||||
INSERT INTO "new_User" ("email", "id", "name", "rootToken") SELECT "email", "id", "name", "rootToken" FROM "User";
|
||||
DROP TABLE "User";
|
||||
ALTER TABLE "new_User" RENAME TO "User";
|
||||
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
|
||||
PRAGMA foreign_key_check;
|
||||
PRAGMA foreign_keys=ON;
|
|
@ -50,6 +50,8 @@ model User {
|
|||
email String @unique
|
||||
name String?
|
||||
|
||||
password String // Will be hashed using bcrypt
|
||||
|
||||
rootToken String?
|
||||
permissions Permission[]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue