If user logout from the app, i'm clearing data from tables one by one using
@Query("DELETE FROM tableName")
Then i'm trying to clear the sqlite_sequence for all table one by one using below code.
database = Room.databaseBuilder(getApplicationContext(), AppDatabase.class, DatabaseMeta.DB_NAME)
.build();
database.query("DELETE FROM sqlite_sequence WHERE name = ?", new Object[]{"tableName"})
Unfortunately clearing sqlite_sequence
is not working. So if the user login again, then the starting rowId is not created from 1.
Is there any other way to do this? I trying to clear whole DB and will add the new entries once the user login again.