feat: add User Prisma model + migration
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "users" (
|
||||||
|
"id" UUID NOT NULL,
|
||||||
|
"email" TEXT NOT NULL,
|
||||||
|
"password_hash" TEXT NOT NULL,
|
||||||
|
"name" TEXT NOT NULL,
|
||||||
|
"created_at" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
|
||||||
|
CONSTRAINT "users_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "users_email_key" ON "users"("email");
|
||||||
@@ -38,3 +38,21 @@ model Request {
|
|||||||
|
|
||||||
@@map("requests")
|
@@map("requests")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Minimal internal auth accounts — NOT company SSO (deliberately ruled out,
|
||||||
|
// see CLAUDE.md / auth decision notes). A handful of trusted IT staff
|
||||||
|
// accounts, created by hand via scripts/create-user.ts, no self-registration.
|
||||||
|
// Auth.js v5 Credentials provider + JWT session strategy is used, so this is
|
||||||
|
// intentionally just a plain user table — no `Account`/`Session`/
|
||||||
|
// `VerificationToken` models, those exist for OAuth account linking / DB
|
||||||
|
// session strategy, neither of which applies here. No `role` field either:
|
||||||
|
// permission model is flat for now (any logged-in user can do anything).
|
||||||
|
model User {
|
||||||
|
id String @id @default(uuid()) @db.Uuid
|
||||||
|
email String @unique
|
||||||
|
passwordHash String @map("password_hash")
|
||||||
|
name String
|
||||||
|
createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz(6)
|
||||||
|
|
||||||
|
@@map("users")
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user