feature: Adds user creation endpoint.
This commit is contained in:
parent
6d0fc93138
commit
35e23357ef
10 changed files with 197 additions and 4 deletions
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
Warnings:
|
||||
|
||||
- Made the column `name` on table `User` required. This step will fail if there are existing NULL values in that column.
|
||||
|
||||
*/
|
||||
-- RedefineTables
|
||||
PRAGMA foreign_keys=OFF;
|
||||
CREATE TABLE "new_User" (
|
||||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
"email" TEXT NOT NULL,
|
||||
"name" TEXT NOT NULL,
|
||||
"password" TEXT NOT NULL,
|
||||
"rootToken" TEXT
|
||||
);
|
||||
INSERT INTO "new_User" ("email", "id", "name", "password", "rootToken") SELECT "email", "id", "name", "password", "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;
|
|
@ -48,7 +48,7 @@ model User {
|
|||
id Int @id @default(autoincrement())
|
||||
|
||||
email String @unique
|
||||
name String?
|
||||
name String
|
||||
|
||||
password String // Will be hashed using bcrypt
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue