Commit d58751bf authored by Daniel Wolf's avatar Daniel Wolf
Browse files

sqlite_sequence may not be dropped

parent 37ba782f
...@@ -48,7 +48,7 @@ public class DatabaseHelper extends com.frostnerd.utils.database.DatabaseHelper ...@@ -48,7 +48,7 @@ public class DatabaseHelper extends com.frostnerd.utils.database.DatabaseHelper
private MockedContext wrappedContext; private MockedContext wrappedContext;
public static DatabaseHelper getInstance(@NonNull Context context){ public static DatabaseHelper getInstance(@NonNull Context context){
return instance == null ? instance = new DatabaseHelper(mock(context)) : instance; return instance == null ? instance = new DatabaseHelper(context.getApplicationContext() != null ? context.getApplicationContext() : context) : instance;
} }
public static boolean instanceActive(){ public static boolean instanceActive(){
...@@ -108,6 +108,7 @@ public class DatabaseHelper extends com.frostnerd.utils.database.DatabaseHelper ...@@ -108,6 +108,7 @@ public class DatabaseHelper extends com.frostnerd.utils.database.DatabaseHelper
cursor.close(); cursor.close();
} }
for(String s: getTableNames(db)){ for(String s: getTableNames(db)){
if(!s.equalsIgnoreCase("sqlite_sequence"))
db.execSQL("DROP TABLE IF EXISTS " + s); db.execSQL("DROP TABLE IF EXISTS " + s);
} }
onCreate(db); onCreate(db);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment