Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Record DB versions in the DB itself, and refuse to downgrade #477

Closed
djmitche opened this issue Oct 31, 2024 · 1 comment · Fixed by #485
Closed

Record DB versions in the DB itself, and refuse to downgrade #477

djmitche opened this issue Oct 31, 2024 · 1 comment · Fixed by #485
Assignees
Milestone

Comments

@djmitche
Copy link
Collaborator

0.9.0 added some schema upgrades, and that might cause issues on a downgrade. Actually, the schemas are compatible, but 0.9.0 leaves sync'd operations in the operations table, using a new boolean column to distinguish synced and un-synced. 0.8.0 doesn't know to look for that column.

For the moment, the 0.9.0 release warns about this, but going forward let's store the TC version in the DB, and just refuse to run with a DB that's newer than the current version of TC. That should both make upgrades easier to handle (if db_version < latest { .. }) and prevent issues with downgrades.

If users do need to downgrade, then deleting the DB and re-syncing should do the job for them.

@djmitche
Copy link
Collaborator Author

This should probably be in some kind of major/minor mode, where two DBs with different majors are not compatible, but minor versions are inter-compatible.

That is, a TaskChampion that uses DB version 8.1 would not be able to interact with a DB at version 9.0, but could still use a DB at version 8.2..

This is important because there are schema changes that are backward-compatible, such as adding indices. We want to use the version number to know if such changes have been applied (rather than dynamically probing at startup, which adds latency), but those should not prevent inter-operation of multiple versions. The changes made in #373 are an example.

@djmitche djmitche moved this from Backlog to Ready in Taskwarrior Development Nov 13, 2024
@djmitche djmitche self-assigned this Nov 26, 2024
@djmitche djmitche moved this from In progress to In review in Taskwarrior Development Nov 27, 2024
@github-project-automation github-project-automation bot moved this from In review to Done in Taskwarrior Development Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant