From 70f8e8ba938d3bae040bc83cdddc5d4fe9602381 Mon Sep 17 00:00:00 2001 From: mcclure Date: Wed, 3 Jan 2024 16:21:18 -0500 Subject: [PATCH] Implement new policy: The database version number is always even (#4128) 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 --- app/src/main/java/com/keylesspalace/tusky/db/AppDatabase.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/com/keylesspalace/tusky/db/AppDatabase.java b/app/src/main/java/com/keylesspalace/tusky/db/AppDatabase.java index 45e186e04..08014baa9 100644 --- a/app/src/main/java/com/keylesspalace/tusky/db/AppDatabase.java +++ b/app/src/main/java/com/keylesspalace/tusky/db/AppDatabase.java @@ -42,6 +42,8 @@ import java.io.File; TimelineAccountEntity.class, ConversationEntity.class }, + // Note: Starting with version 54, database versions in Tusky are always even. + // This is to reserve odd version numbers for use by forks. version = 56, autoMigrations = { @AutoMigration(from = 48, to = 49),