when I uninstall my App, it seems like the SQLite Database wouldn’t deleted .
I uninstalled my App and installed it again and the data in DB are the same as before.
This is my code how I create the database:
createTables(){
return this.db.openDatabase({
name: 'resper.db',
location: 'default'
}).then(() => {
this.db.executeSql('CREATE TABLE IF NOT EXISTS versions(id INTEGER PRIMARY KEY, name TEXT, nr INTEGER)',{}).then(() => {
this.db.executeSql('INSERT OR IGNORE INTO versions VALUES (1,"medisMain",0)',{});
});
this.db.executeSql('CREATE TABLE IF NOT EXISTS medis(id INTEGER PRIMARY KEY, wirk TEXT, form TEXT, formShort TEXT, indi TEXT, kontra TEXT, bem TEXT, erw TEXT, kind TEXT, handel TEXT, neben TEXT)',{});
});
}
with this line I insert a starting value in the database:
this.db.executeSql('INSERT OR IGNORE INTO versions VALUES (1,"medisMain",0)',{});
The third value will be increased by some actions wich do the user in the app. When I now uninstall the app from my phone an reinstall it, the value is the same as before and not 0.
Resper I have the same exact issue as you. I am using the update feature that ionic provides. When I make changes to my sqlite db and I use the update button, my database in the phone has not updated.
I tried using the window.plugins.sqlDB.remove method to remove the old db before the update so that my window.plugins.sqlDB.copy will copy the updated db from local storage to device.
Wonder if anyone knows how to remove the sqlite db from phone so that the same named sqlite db (with updated data) can be put into the device.