Files
FEDEO/backend/db/schema/auth_role_permisssions.ts
2026-01-06 12:07:43 +01:00

24 lines
700 B
TypeScript

import { pgTable, uuid, text, timestamp } from "drizzle-orm/pg-core"
import { authRoles } from "./auth_roles"
export const authRolePermissions = pgTable(
"auth_role_permissions",
{
created_at: timestamp("created_at", { withTimezone: true })
.notNull()
.defaultNow(),
role_id: uuid("role_id")
.notNull()
.references(() => authRoles.id),
permission: text("permission").notNull(),
},
(table) => ({
primaryKey: [table.role_id, table.permission],
})
)
export type AuthRolePermission = typeof authRolePermissions.$inferSelect
export type NewAuthRolePermission = typeof authRolePermissions.$inferInsert