gitbayd: log when a restart moves the schema !115

merged merged by cmc on 2026-08-30 02:24 UTC · krz/gitbay:migration-log into main

Discussion

cmc

openStore runs MigrateUp on every start and logged nothing, so a schema change was invisible. When gitbay.org turned out to be at user_version 27 before 0027 had merged, nothing in the journal connected that to the deploy that did it — pinning it down took strings /usr/local/bin/gitbayd.

Now it reads the version either side of MigrateUp and logs schema migrated from=N to=M when they differ. An already-current database stays silent, so a routine restart does not claim a migration that did not happen. The migrate subcommand is unaffected: it already prints its result.

Test covers both directions, and was checked against the unpatched function to confirm it fails without the log line.

Ref #28.