@Test public void dropsLastLimboFreeSnapshotIfPreviouslyDowngraded() { schema.runMigrations(0, 9); db.execSQL( "INSERT INTO targets (target_id, canonical_id, target_proto) VALUES (?,?, ?)", new Object[] {1, "foo", createDummyQueryTargetWithLimboFreeVersion(1).toByteArray()}); db.execSQL( "INSERT INTO targets (target_id, canonical_id, target_proto) VALUES (?, ?, ?)", new Object[] {2, "bar", createDummyQueryTargetWithLimboFreeVersion(2).toByteArray()}); db.execSQL( "INSERT INTO targets (target_id, canonical_id, target_proto) VALUES (?,?, ?)", new Object[] {3, "baz", createDummyQueryTargetWithLimboFreeVersion(3).toByteArray()}); schema.runMigrations(0, 8); schema.runMigrations(8, 10); int rowCount = new SQLitePersistence.Query(db, "SELECT target_id, target_proto FROM targets") .forEach( cursor -> { int targetId = cursor.getInt(0); byte[] targetProtoBytes = cursor.getBlob(1); try { Target targetProto = Target.parseFrom(targetProtoBytes); assertEquals(targetId, targetProto.getTargetId()); assertFalse(targetProto.hasLastLimboFreeSnapshotVersion()); } catch (InvalidProtocolBufferException e) { fail("Failed to decode Query data"); } }); assertEquals(3, rowCount); }
void runMigrations() { runMigrations(0, VERSION); }
SQLiteSchema { void runMigrations() { runMigrations(0, VERSION); } }
SQLiteSchema { void runMigrations() { runMigrations(0, VERSION); } SQLiteSchema(SQLiteDatabase db, LocalSerializer serializer); }
SQLiteSchema { void runMigrations() { runMigrations(0, VERSION); } SQLiteSchema(SQLiteDatabase db, LocalSerializer serializer);  }
SQLiteSchema { void runMigrations() { runMigrations(0, VERSION); } SQLiteSchema(SQLiteDatabase db, LocalSerializer serializer);   }