Generate the next version
Add the column insrc/schema.ts, then run the generator.
src/schema.ts
src/migrations/v2.json, src/migrations/v2.ts, and an updated src/migrations.ts, then verifies the complete digest chain. The TypeScript file contains both the immutable schema snapshot and the reviewed additive statements.
Never edit a migration after it has run in any shared environment. Generate a new version instead.
Prove the upgrade
Run the migration test against both an empty database and the previous schema version.Apply it
bun run deploy uploads the Worker and runs the packaged journal in maintenance mode. Application traffic stays closed while CharDB upgrades each organization shard and the Better Auth catalog.
If the command stops halfway through, rerun it with the same migration ID and target. CharDB resumes from durable progress rather than replaying completed steps.
Schema history moves forward. There is no down migration, rollback endpoint, or abort path for statements that already ran. To undo an application change, ship another forward migration and compatible code.