01 · Before and afterThe pattern
// schema.ts: this alone changes nothing on an existing database
version: text("version").default("2.0.0"),
// the live default only moves with a migration:
// ALTER TABLE app ALTER COLUMN version SET DEFAULT '2.0.0';
// or: keep the stable default and offer newer versions as an opt-in choice02 · Run it on your appThe check
When you change a column default in your ORM schema, do you ship the migration that changes it in the database too?
If the honest answer is no or not sure, this is worth a look before it reaches production.