Add User model
This commit is contained in:
13
api/db/migrations/20220208231150_create_user/migration.sql
Normal file
13
api/db/migrations/20220208231150_create_user/migration.sql
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "User" (
|
||||||
|
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||||
|
"name" TEXT,
|
||||||
|
"email" TEXT NOT NULL,
|
||||||
|
"hashedPassword" TEXT NOT NULL,
|
||||||
|
"salt" TEXT NOT NULL,
|
||||||
|
"resetToken" TEXT,
|
||||||
|
"resetTokenExpiresAt" DATETIME
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
# Please do not edit this file manually
|
# Please do not edit this file manually
|
||||||
|
# It should be added in your version-control system (i.e. Git)
|
||||||
provider = "sqlite"
|
provider = "sqlite"
|
||||||
@@ -22,3 +22,13 @@ model Contact {
|
|||||||
message String
|
message String
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
model User {
|
||||||
|
id Int @id @default(autoincrement())
|
||||||
|
name String?
|
||||||
|
email String @unique
|
||||||
|
hashedPassword String
|
||||||
|
salt String
|
||||||
|
resetToken String?
|
||||||
|
resetTokenExpiresAt DateTime?
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user