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

Policy request: Only use even database version numbers #3999

Closed
mcclure opened this issue Sep 6, 2023 · 1 comment
Closed

Policy request: Only use even database version numbers #3999

mcclure opened this issue Sep 6, 2023 · 1 comment

Comments

@mcclure
Copy link
Collaborator

mcclure commented Sep 6, 2023

This is a little arcane, and it's entirely possible it will never benefit anyone but me. But, it is low-cost to implement…

Motivation

I don't use mainline Tusky. I use a personal fork with some idiosyncratic patches. Every major release of mainline Tusky, I re-base my patches on top of the new release. This has worked fine so far. But when v24 releases, I will have a problem. My v23 includes a patch which changes the database format, and so it introduces a database version 52. But when "real" Tusky v24 comes out, it will introduce its own database version 52. And that will result in not only a conflict, but also a big awkward upgrade issue. Either the migration to REAL-52 will be done wrong, or I will have to patch v24 so REAL-52 becomes 53. But then someday Tusky will bump to version 53, and then I'll have to remember that REAL-52 is ANDI-53 and REAL-53 is ANDI-55 and REAL-54 is… you see the problem? It will get more and more confusing with time.

Request

Beginning with v24, introduce a policy that Tusky database-version numbers are always even. This will help fork-users like me, because it will mean the even numbers are reserved for Tusky mainline and the odd numbers are reserved for forks. A fork maintainer can drop any database changes into the odd numbers and when the next version comes, they only have to change the migration number to bump from odd to even, they don't have to change the new database number's number.

(Making the database number always odd, and reserving even numbers for forks, would also solve the problem, and would coincidentally work even better for me, but I think "even only" is less confusing for the Tusky mainline and the most important thing is to keep Tusky mainline understandable.)

@Lakoja
Copy link
Collaborator

Lakoja commented Sep 6, 2023

(Just as an idea: We could use "date-based numbers" like for the settings schema. E.g. database version 2023073012.)

mcclure added a commit to mcclure/Tusky that referenced this issue Nov 28, 2023
connyduck added a commit that referenced this issue Jan 3, 2024
Posted this as issue #3999 before. The reasoning is personal experiments
and forks may add database fields and must bump the database number to
do so, but this causes massive merge difficulties when Tusky then
inevitably itself bumps the number. To alleviate this, Tusky official
should use only even database numbers, so odd versions are available for
third party scribbling.

There was little discussion positive or negative in #3999 (one proposal
we switch to a date-based number system, which would work but also could
be unnecessarily complicated). With PR #4115 we now have to make a
decision because that's the first post-proposal PR to bump the database
number odd. So, since I see no outright objections, I'd like to
implement this.

@connyduck suggested the best way to implement the proposal would be to
add a comment to the version number's home in AppDatabase.java.

Co-authored-by: Konrad Pozniak <connyduck@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants