Files
FEDEO/db/schema/auth_roles.ts
2025-12-06 19:29:28 +01:00

20 lines
632 B
TypeScript

import { pgTable, uuid, text, timestamp, bigint } from "drizzle-orm/pg-core"
import { authUsers } from "./auth_users"
export const authRoles = pgTable("auth_roles", {
id: uuid("id").primaryKey().defaultRandom(),
created_at: timestamp("created_at", { withTimezone: true })
.notNull()
.defaultNow(),
name: text("name").notNull(),
description: text("description"),
created_by: uuid("created_by").references(() => authUsers.id),
tenant_id: bigint("tenant_id", {mode: "number"}),
})
export type AuthRole = typeof authRoles.$inferSelect
export type NewAuthRole = typeof authRoles.$inferInsert