Skip to content

Unify database migration system #139

Description

@DylanDevelops

The feature request

The database initialization currently mixes two different schema management patterns. storage.Initialize() executes ad-hoc ALTER TABLE queries and relies on string-matching errors ("duplicate column name") to skip existing columns, while an actual migration system exists in migrations.go for timezone updates.

Proposed solution

Fold the ALTER TABLE modifications into the numbered migration system. This will ensure CurrentSchemaVersion accurately reflects the state of the database and removes fragile error-string parsing from the initialization sequence.

Additional context

For safety, an automatic VACUUM INTO backup should be triggered right before applying new migrations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions