From 64f3418676ea1a10f30a03edb33ba962e1c5a725 Mon Sep 17 00:00:00 2001 From: Addison LeClair Date: Sat, 18 Jul 2026 01:19:17 -0700 Subject: [PATCH] fix: declare custom organization columns so auth:schema preserves them --- apps/dashboard/auth.config.ts | 29 ++++++++++++++++++- .../src/lib/server/db/auth.schema.ts | 2 +- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/apps/dashboard/auth.config.ts b/apps/dashboard/auth.config.ts index 8d15faf..579a642 100644 --- a/apps/dashboard/auth.config.ts +++ b/apps/dashboard/auth.config.ts @@ -41,7 +41,34 @@ export default betterAuth({ admin({ defaultRole: 'user' }), twoFactor(), passkey(), - organization({ ac, roles: organizationRoles }), + organization({ + ac, + roles: organizationRoles, + schema: { + organization: { + additionalFields: { + billingExempt: { + type: 'boolean', + input: false, + required: true, + defaultValue: false + }, + disabled: { + type: 'boolean', + input: false, + required: true, + defaultValue: false + }, + deletedAt: { + type: 'number', + bigint: true, + input: false, + required: false + } + } + } + } + }), autumn({ customerScope: 'organization' }) ] }); diff --git a/apps/dashboard/src/lib/server/db/auth.schema.ts b/apps/dashboard/src/lib/server/db/auth.schema.ts index 9d710a0..63a16c7 100644 --- a/apps/dashboard/src/lib/server/db/auth.schema.ts +++ b/apps/dashboard/src/lib/server/db/auth.schema.ts @@ -2,9 +2,9 @@ import { relations } from 'drizzle-orm'; import { pgTable, text, + bigint, timestamp, boolean, - bigint, integer, index, uniqueIndex