This document tracks upgrade notes that need more context than the changelog. Keep the newest entry first and focus on operator-facing changes: required env renames, database migrations, auth changes, removed behavior, and any manual validation needed after deploy.
Upgrade from: 1.1.103
Why this needs a minor bump instead of 1.1.104:
- Authentication moved from NextAuth to Better Auth
- Required auth environment variables changed
- The auth-related Prisma schema changed and needs a database migration
AUTH_SECRETis replaced byBETTER_AUTH_SECRETAUTH_URLis replaced byBETTER_AUTH_URLNEXTAUTH_SECRETis replaced byBETTER_AUTH_SECRETNEXTAUTH_URLis replaced byBETTER_AUTH_URLAUTH_DEBUGis no longer usedAUTH_TRUST_HOSTis no longer used- The auth database schema now uses the Better Auth-compatible layout
Airbroke ships the Prisma migration
prisma/migrations/20260322190000_better_auth/migration.sql for this upgrade.
The migration performs these schema changes:
accountsmoves from NextAuth-styleprovider/provider_account_idfields to Better Auth-styleprovider_id/account_idsessionsmoves fromsession_tokentotokenusers.email_verifiedmoves from timestamp-based semantics to booleanverification_tokensis replaced byverifications
Operational hurdle to account for before rollout:
- Prisma migrations must run as the owning role of the existing auth tables
- if legacy tables such as
accounts,sessions,users, orverification_tokensare owned bypostgresor another superuser while the app connects asairbroke, the migration can fail withERROR: must be owner of table accounts - on existing installations, verify table ownership before rollout and fix it before retrying a failed migration
- Deploy the 1.2.0 code and install dependencies
- Update environment variables:
- set
BETTER_AUTH_SECRET - set
BETTER_AUTH_URL - remove legacy
AUTH_SECRET,AUTH_URL,NEXTAUTH_SECRET,NEXTAUTH_URL,AUTH_DEBUG, andAUTH_TRUST_HOST - if you deploy through Helm or another manifest layer, update renamed env keys there too, not only in the secret payload
- set
- Run the database migration:
corepack yarn db:migrate- ensure the database user running migrations owns the auth tables in
public - if Prisma already recorded a failed
20260322190000_better_authmigration, resolve that failed row before retrying deploy
- Verify sign-in and sign-out flows against the providers you have enabled
- Expect existing sessions to require re-authentication after the auth-system switch
- confirm
/api/auth/[...all]is reachable in the deployed app - confirm
/signinshows the configured providers instead of an empty list - confirm at least one real provider login succeeds
- confirm protected routes still redirect anonymous users correctly
- confirm new sessions are persisted in the updated
sessionstable layout
Use this shape for future entries:
## x.y.z
Upgrade from: previous supported version range
Why this needs a version bump:
- short reason
### Breaking changes
- item
### Database changes
- item
### Upgrade steps
1. step
### Post-upgrade checks
- item