-
-
Notifications
You must be signed in to change notification settings - Fork 3
Unify database migration system #139
Copy link
Copy link
Open
Labels
status: awaiting triageWaiting for an issue to be addressed.Waiting for an issue to be addressed.type: feature requestAn issue containing a feature request.An issue containing a feature request.
Description
Metadata
Metadata
Assignees
Labels
status: awaiting triageWaiting for an issue to be addressed.Waiting for an issue to be addressed.type: feature requestAn issue containing a feature request.An issue containing a feature request.
The feature request
The database initialization currently mixes two different schema management patterns.
storage.Initialize()executes ad-hocALTER TABLEqueries and relies on string-matching errors ("duplicate column name") to skip existing columns, while an actual migration system exists inmigrations.gofor timezone updates.Proposed solution
Fold the
ALTER TABLEmodifications into the numbered migration system. This will ensureCurrentSchemaVersionaccurately reflects the state of the database and removes fragile error-string parsing from the initialization sequence.Additional context
For safety, an automatic
VACUUM INTObackup should be triggered right before applying new migrations.