From 12fdd570b33b4ab2194a0d14ed79dc926ceb1a43 Mon Sep 17 00:00:00 2001 From: Imanol Fernandez Date: Tue, 5 May 2020 19:22:39 +0200 Subject: [PATCH] Fix v2 to v3 Database migration --- .../shared/org/mozilla/vrbrowser/db/AppDatabase.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/app/src/common/shared/org/mozilla/vrbrowser/db/AppDatabase.java b/app/src/common/shared/org/mozilla/vrbrowser/db/AppDatabase.java index d7a071129b..8f38516b12 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/db/AppDatabase.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/db/AppDatabase.java @@ -38,7 +38,7 @@ public static AppDatabase getAppDatabase(Context context, final AppExecutors exe @NonNull private static AppDatabase buildDatabase(final @NonNull Context appContext, final @NonNull AppExecutors executors) { return Room.databaseBuilder(appContext, AppDatabase.class, DATABASE_NAME) - .addMigrations(MIGRATION_1_2) + .addMigrations(MIGRATION_1_2, MIGRATION_2_3) .addCallback(new Callback() { @Override public void onCreate(@NonNull SupportSQLiteDatabase db) { @@ -87,15 +87,6 @@ public void migrate(SupportSQLiteDatabase database) { } }; - private static final Migration MIGRATION_1_3 = new Migration(1, 3) { - @Override - public void migrate(SupportSQLiteDatabase database) { - database.execSQL("ALTER TABLE PopUpSite RENAME TO SitePermission"); - database.execSQL("ALTER TABLE SitePermission ADD COLUMN category INTEGER NOT NULL DEFAULT 0"); - database.execSQL("ALTER TABLE SitePermission ADD COLUMN principal STRING NOT NULL DEFAULT ''"); - } - }; - private static final Migration MIGRATION_2_3 = new Migration(2, 3) { @Override public void migrate(SupportSQLiteDatabase database) {