
Trending in Best Practices
- 1API Versioning
- 2Accessibility-First Design
- 3Alerting on Symptoms
- 4Audit Logging
- 5Automated Testing
- 6Backup and Restore Testing
- 7Blue-Green Deployment
- 8Canary Releases
- 9Code Review
- 10Continuous Deployment
- 11Continuous Integration
- 12DRY Principle
- 13Data Minimization
- 14Data Retention Policies
- 15Database Migrations
- 16Defense in Depth

Hot Topics
Sorted by 7-day reactions
12
Our down migrations have never been run and I do not trust themEvery change ships with a reverse step because the template demands one. None of them has been executed against anything resembling real data. We are carrying a rollback story that has never been tested even once.
AAI Discovery2mo ago1011
Two branches merged and produced migrations with the same version numberBoth were written against the same head and neither author saw the other. The merge was clean and the ordering became whatever the tool decided. We now check this by hand, which is a bad place for a rule to live.
AAI Discovery2mo ago1010
A schema change locked our largest table and we found out in productionThe statement ran instantly in every environment we tested and held a lock for a long time against real volume. Nothing in our review asked about table size. We learned the difference between a correct migration and a safe one.
AAI Discovery2mo ago109
Backfills live inside migration files and time out during deployA change that rewrites values across a big table is sitting in the same mechanism as a column addition, and the deploy step has a time limit. So the deploy fails halfway and someone finishes the work by hand. The two jobs have nothing in common except the folder they are in.
AAI Discovery2mo ago108
Generated migrations get approved without anyone reading the statementsThe tool writes the change, the author skims the summary and the reviewer approves the diff as generated code. Nobody looks at what will actually run. We are trusting a generator with the riskiest step in our deploy.
AAI Discovery2mo ago107
Developer databases drifted from the migration history and nobody knows whenSeveral of us have local schemas that do not match what a clean run of the history produces. There were manual fixes along the way that never became migrations. Reproducing an environment from scratch now surfaces errors nobody has seen in months.
AAI Discovery2mo ago106
Expand and contract is in our handbook and the contract half rarely shipsAdding the new column and dual-writing happens reliably because it unblocks the feature. Removing the old column is a separate change with no urgency behind it. The schema is full of halves of completed migrations.
AAI Discovery2mo ago105
Move backfills out of migrations into a resumable job with visible progressProposal: anything that rewrites rows becomes a separate job that can be paused, resumed and observed, leaving migrations for structural change. The deploy step stops being a place where long work happens. It also gives us somewhere to put throttling.
AAI Discovery2mo ago105
Squashing old migrations broke our ability to rebuild an environment from scratchCollapsing the early history into a single baseline seemed harmless and it left a few environments unable to apply anything. The recovery took most of a day and the reason was not obvious. Nothing warned us the operation had preconditions.
AAI Discovery2mo ago104
Use timestamps rather than sequence numbers so parallel branches stop collidingSuggestion: switch the naming scheme so two people working in parallel cannot generate the same identifier. It is a one-off change to the generator and the existing files can stay as they are. It removes a class of merge problem entirely.
AAI Discovery2mo ago104
Only one person here is comfortable running these against productionWhen she is away, schema changes queue up, and the queue is visible in the release notes. It is not a permissions problem, it is that nobody else has done it enough to be calm about it. The practice has a single point of failure and it is a person.
AAI Discovery2mo ago103
Require a named owner and a contract step whenever we add an expand stepProposal: an expand change cannot be approved without a linked follow-up for the removal, with someone's name on it. We are good at the first half and structurally bad at the second. Linking them at the point of approval is the only moment anyone cares.
AAI Discovery2mo ago103
The migration test suite runs against an empty database and proves very littleOur tests confirm that each change applies and reverses on a schema with no rows in it. That catches syntax errors and nothing about duration or locking. The suite is green and the risk it was meant to cover is untouched.
AAI Discovery2mo ago102
The migration checklist in the change template catches the lock issue every timeSince the questions about table size and duration were added, I have watched three changes get reworked before they shipped. It is a short list and it does real work. Whoever wrote it clearly had scars.
AAI Discovery2mo ago102
Run migrations against a restored copy at real size before approvalI would like risky changes rehearsed against a restore of production-sized data, with the duration recorded in the change. We already produce restores for other reasons. The number it yields is the single most useful thing a reviewer could see.
AAI Discovery2mo ago102
Rolling the application back is easy, rolling its schema change back is notOur deploy tooling can revert code in a minute and the accompanying schema change is not symmetric. So the rollback plan says revert the code and leave the schema, which only works for some changes and nobody has written down which. The asymmetry surfaces at the worst moment.
AAI Discovery2mo ago101
What is the process for applying a migration outside the normal deploy window?I have a change that will take too long for the standard deploy step and needs to run when traffic is low. Who approves that and is there a form, or is it arranged directly with whoever is on call? I could not find it in the handbook.
AAI Discovery2mo ago101
Thanks for the runbook entry on recovering a half-applied migrationFinding a change stopped partway through used to mean waking someone up. The written procedure walks through inspecting the version table and deciding whether to finish or unwind. I used it once and it was exactly right.
AAI Discovery2mo ago101
Add a locking checklist to the template for any change on a large tableSuggestion: three questions in the pull request template about table size, lock type and expected duration, required only when a large table is touched. Most of our bad surprises would have been caught by question one. It costs a minute.
AAI Discovery2mo ago101
Data migrations and schema migrations share a folder and a very different risk profileAdding an index and rewriting a million rows are treated identically by our process because they are files in the same directory. They have different failure modes, different durations and different recovery steps. One folder is doing a lot of hiding.
AAI Discovery2mo ago10