]> git.ktnx.net Git - mobile-ledger.git/commitdiff
dummy migration method
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 15 Apr 2021 18:39:34 +0000 (18:39 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 15 Apr 2021 18:39:34 +0000 (18:39 +0000)
it appeared useful at a point, but later the fix was another

still, it may be handy in the future

app/src/main/java/net/ktnx/mobileledger/db/DB.java

index ca2d9092bd7f693e765565980456cae9628f8c4e..683d54b50d774cd28a045da3c873175ac5563615 100644 (file)
@@ -38,6 +38,7 @@ import net.ktnx.mobileledger.dao.ProfileDAO;
 import net.ktnx.mobileledger.dao.TemplateAccountDAO;
 import net.ktnx.mobileledger.dao.TemplateHeaderDAO;
 import net.ktnx.mobileledger.dao.TransactionDAO;
+import net.ktnx.mobileledger.utils.Logger;
 
 import java.io.BufferedReader;
 import java.io.IOException;
@@ -120,6 +121,15 @@ abstract public class DB extends RoomDatabase {
             }
         };
     }
+    private static Migration dummyVersionMigration(int toVersion) {
+        return new Migration(toVersion - 1, toVersion) {
+            @Override
+            public void migrate(@NonNull SupportSQLiteDatabase db) {
+                Logger.debug("db",
+                        String.format(Locale.ROOT, "Dummy DB migration to version %d", toVersion));
+            }
+        };
+    }
     private static Migration multiVersionMigration(int fromVersion, int toVersion) {
         return new Migration(fromVersion, toVersion) {
             @Override