[AC-2988] Database.remove + database.install updates the database after restart of the app in iOS
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2012-01-03T17:51:18.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | n/a |
Reporter | Rene Pot |
Assignee | Paul Dowsett |
Created | 2011-11-10T00:26:33.000+0000 |
Updated | 2016-03-08T07:47:59.000+0000 |
Description
When doing database.remove() the database is still available, but after restart the new one is available.
As the install does only works once, the database does not update if the file does. Therefore I want to remove the database, and re-install it. This works on android, but not on iOS, but only after a restart of the app. I think this is therefore a bug.
Code snippet:
var version = '3';
var DB = Ti.Database.install(Titanium.Filesystem.resourcesDirectory + 'db.sqlite','db');
var queryResult = DB.execute('SELECT value FROM config WHERE name = "version"');
if (queryResult.isValidRow() && queryResult.fieldByName('value') != version){
DB.remove();
var DB = Ti.Database.install(Titanium.Filesystem.resourcesDirectory + 'db.sqlite','db');
}
Thank you for raising this ticket. If you are able to provide all the information described in the [JIRA Ticket Checklist](http://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-JIRATicketChecklist) guidelines, *in the correct fields and using the right format*, we will be able to escalate it to the core team. Thanks in advance.
DB.remove() is currently an Android-only feature. Please see TIMOB-6969, which requests an equivalent method. Thanks for bringing my attention to this. I'm closing this now.