Harden user management integration
This commit is contained in:
parent
73579d1e79
commit
847f4e9493
18 changed files with 394 additions and 111 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { sql } from "drizzle-orm";
|
||||
import { integer, sqliteTable, text, uniqueIndex } from "drizzle-orm/sqlite-core";
|
||||
import type { UserRole } from "../../shared/constants/user-roles.js";
|
||||
|
||||
export const users = sqliteTable(
|
||||
"users",
|
||||
|
|
@ -8,7 +9,7 @@ export const users = sqliteTable(
|
|||
username: text("username").notNull(),
|
||||
passwordHash: text("password_hash").notNull(),
|
||||
name: text("name").notNull(),
|
||||
role: text("role").notNull().default("user"),
|
||||
role: text("role").$type<UserRole>().notNull().default("user"),
|
||||
active: integer("active", { mode: "boolean" }).notNull().default(true),
|
||||
mustChangePassword: integer("must_change_password", { mode: "boolean" })
|
||||
.notNull()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue