Skip to content

Compare changes

Choose two branches to see what one has that the other does not, then open a pull request for it.

Open a pull request

1 commit

1 file+18−00/1 viewed
+18−0
152152 6. Prints a table: unit, stage, result, version id, time. Each unit's full
153153 output is kept in `$TMPDIR/g1t-deploy/<unit>.log`.
154154
155+#### Migrations run while the old code is still live
156+
157+Migrations apply before any code, and a stage takes a minute or more, so
158+for that long the code in production is the old code reading the new
159+schema. A migration must keep the old code right:
160+
161+- **Add, never change meaning.** New tables and columns (with defaults) are
162+ safe. Rewriting what existing rows mean is not: on 2026-10-08,
163+ `billing/0039` turned comped accounts into `custom` terms at 100%, and
164+ for about 40 seconds the old billing code, which knew only `comped`, saw
165+ flagon-io as a free workspace and refused its workflows.
166+- **Change meaning in two deploys.** First ship code that reads both the old
167+ and the new form (and keeps writing the old one); then, in a later
168+ deploy, the migration that rewrites the rows; then, if you like, code
169+ that drops the old form.
170+- **Never drop or rename** a column or table the live code reads in the same
171+ deploy that stops reading it.
172+
155173 #### Telling the status page about a deploy
156174
157175 Restarts during a deploy can make a part slow for a minute, which the