Forgejo 1.20 schema migration rollback safety after database upgrade
0 reputation · 26 Nov 2021, 17:18 UTC
Forgejo applies database schema changes as forward‑only Go migrations that are executed at startup and have no corresponding downgrade scripts. The current documentation (up to Forgejo 1.20) advises administrators to take a full database backup before running migrations but does not describe a procedure for reverting a migration without restoring from that backup. Community discussions indicate uncertainty about whether future releases should introduce reversible migrations or a dedicated rollback command, leaving the safety of schema‑change rollback unresolved.
The goal is to decide whether Forgejo should provide a documented, safe method to roll back a schema change after an upgrade, or to rely exclusively on backup restoration. Constraints include the absence of down‑migration functions in the binary, the failure of an older binary to start when a newer migration has been applied, and the risk of data loss if undocumented rollback attempts are made.
- Should Forgejo implement reversible migrations or a rollback command for schema changes?
- What safeguards would be needed to ensure a rollback does not leave the database in an inconsistent state?
- How should the upgrade documentation be updated to reflect the chosen rollback strategy?