diff --git a/api/db/migrations/20220208231150_create_user/migration.sql b/api/db/migrations/20220208231150_create_user/migration.sql new file mode 100644 index 0000000..a29dfad --- /dev/null +++ b/api/db/migrations/20220208231150_create_user/migration.sql @@ -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"); diff --git a/api/db/migrations/migration_lock.toml b/api/db/migrations/migration_lock.toml index 963afcc..e5e5c47 100644 --- a/api/db/migrations/migration_lock.toml +++ b/api/db/migrations/migration_lock.toml @@ -1,2 +1,3 @@ # Please do not edit this file manually +# It should be added in your version-control system (i.e. Git) provider = "sqlite" \ No newline at end of file diff --git a/api/db/schema.prisma b/api/db/schema.prisma index 7c6c24a..24e6494 100644 --- a/api/db/schema.prisma +++ b/api/db/schema.prisma @@ -22,3 +22,13 @@ model Contact { message String createdAt DateTime @default(now()) } + +model User { + id Int @id @default(autoincrement()) + name String? + email String @unique + hashedPassword String + salt String + resetToken String? + resetTokenExpiresAt DateTime? +}