@Test public void dropsHeldWriteAcks() { schema.runMigrations(0, 5); addMutationBatch(db, 1, "userA", "docs/foo"); addMutationBatch(db, 2, "userA", "docs/foo"); addMutationBatch(db, 3, "userB", "docs/bar", "doc/baz"); addMutationBatch(db, 4, "userB", "docs/pending"); addMutationBatch(db, 5, "userA", "docs/pending"); db.execSQL( "INSERT INTO mutation_queues (uid, last_acknowledged_batch_id) VALUES (?, ?)", new Object[] {"userA", 2}); db.execSQL( "INSERT INTO mutation_queues (uid, last_acknowledged_batch_id) VALUES (?, ?)", new Object[] {"userB", 3}); db.execSQL( "INSERT INTO mutation_queues (uid, last_acknowledged_batch_id) VALUES (?, ?)", new Object[] {"userC", -1}); schema.runMigrations(5, 6); new SQLitePersistence.Query(db, "SELECT COUNT(*) FROM mutations") .first(value -> assertEquals(2, value.getInt(0))); new SQLitePersistence.Query(db, "SELECT COUNT(*) FROM document_mutations") .first(value -> assertEquals(2, value.getInt(0))); new SQLitePersistence.Query(db, "SELECT COUNT(*) FROM mutation_queues") .first(value -> assertEquals(3, value.getInt(0))); }
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);   }