Added Backend

This commit is contained in:
2026-01-06 12:07:43 +01:00
parent b013ef8f4b
commit 6f3d4c0bff
165 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
import { pgTable, uuid, bigint, timestamp } from "drizzle-orm/pg-core"
import { authUsers } from "./auth_users"
export const authTenantUsers = pgTable(
"auth_tenant_users",
{
created_at: timestamp("created_at", { withTimezone: true })
.notNull()
.defaultNow(),
tenant_id: bigint("tenant_id", { mode: "number" }).notNull(),
user_id: uuid("user_id").notNull(),
created_by: uuid("created_by").references(() => authUsers.id),
},
(table) => ({
primaryKey: [table.tenant_id, table.user_id],
})
)
export type AuthTenantUser = typeof authTenantUsers.$inferSelect
export type NewAuthTenantUser = typeof authTenantUsers.$inferInsert