>> Notes /
Auralar: why putting back a release is safe
This note is about Auralar, the family wall calendar.
One click back, but only for code
Auralar's administration panel has a Put back button. After a release, if something is wrong, it restores the previous version's files. It is meant to be used without hesitation, which only works if it cannot make things worse.
The catch is the database. Put back restores code, not data. Families keep ticking chores and editing their week while a release is live, and rolling the database back would throw that work away. So after a Put back, the older code runs against the newer database. That has to be safe every time, not just usually.
The rule: the database only grows
Every database change in Auralar is a numbered migration file, applied once. There are 78 of them so far. The rule for new ones is short: additive only.
- New tables are fine.
- New columns are fine if they allow empty values or have a default.
- New settings keys are fine.
- Dropping, renaming or changing an existing column is not. Neither is renaming or emptying a table, or rewriting existing customer rows.
Older code simply ignores tables and columns it does not know about. As long as nothing it relies on disappears or changes shape, it keeps working.
A rule that checks itself
Rules written in a README get forgotten. So the release checks include a guard that reads every new migration's SQL before anything is installed. It splits the file into statements while ignoring comments and quoted text, then refuses anything that drops, renames, modifies or truncates. It also looks inside MySQL's special "executable comments", which look like comments but run as SQL.
A migration that breaks the rule fails the checks, and that release never reaches the server. The guard is static: it does not replace reading a migration carefully, but it catches the most dangerous mistakes automatically.
Builds that know who they are
Every deployable change carries a build number in the form year, month, day and a counter, and it has to match in two places, server and browser. A commit that changes code without a new build number is skipped. That keeps "which version is running" a fact rather than a guess, and it is what Put back points at.
Backups as the last line
Before every migration, release and restore, the server takes a safety copy of the database. There is also a nightly backup, and once a week a restore test checks that the backups can actually be read back. Those are for real disasters. The point of the additive rule is that a normal bad release never needs them.
The trade-off
The database collects leftovers. A column that is no longer used stays until a deliberate clean-up, done separately and carefully. Some changes take two steps instead of one: add the new shape, move code over, and only much later retire the old one.
That is slower than changing a column in place. It is also why a bad release costs a click instead of an evening.