From 6a6b8406a45ffab6c6cf794144b996732718c1a2 Mon Sep 17 00:00:00 2001 From: Chneemann Date: Fri, 21 Aug 2026 03:55:57 +0200 Subject: [PATCH] feat(db): add role field and role enum to users table schema --- db/schema.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/db/schema.ts b/db/schema.ts index 6a3940f..95f832d 100644 --- a/db/schema.ts +++ b/db/schema.ts @@ -36,6 +36,11 @@ export const taskPriorityEnum = pgEnum("task_priority", [ "high", ]); +/** + * Enumeration representing access control roles assigned to application users. + */ +export const userRoleEnum = pgEnum("user_role", ["admin", "member", "guest"]); + // ========================================== // Tables // ========================================== @@ -49,6 +54,7 @@ export const usersTable = pgTable("users", { password: text("password").notNull(), firstName: text("first_name").notNull(), lastName: text("last_name").notNull(), + role: text("role").default("member").notNull(), color: text("color").default("bg-indigo-500").notNull(), lastLogin: timestamp("last_login"), isOnline: boolean("is_online").default(false).notNull(),