{ "id": "82587", "key": "AC-2988", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2012-01-03T17:51:18.000+0000", "created": "2011-11-10T00:26:33.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "updated": "2016-03-08T07:47:59.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "When doing database.remove() the database is still available, but after restart the new one is available.\r\n\r\nAs 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.\r\n\r\nCode snippet:\r\n{code}\r\nvar version = '3';\r\nvar DB = Ti.Database.install(Titanium.Filesystem.resourcesDirectory + 'db.sqlite','db');\r\nvar queryResult = DB.execute('SELECT value FROM config WHERE name = \"version\"');\r\nif (queryResult.isValidRow() && queryResult.fieldByName('value') != version){\r\n DB.remove(); \r\n var DB = Ti.Database.install(Titanium.Filesystem.resourcesDirectory + 'db.sqlite','db');\r\n}\r\n{code}", "attachment": [], "flagged": false, "summary": "Database.remove + database.install updates the database after restart of the app in iOS", "creator": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Titanium SDK version: 1.7.3\r\nPlatform & version: iOS 4.x & iOS 5.0\r\nDevice Details: iOS mobile & emulator\r\nHost Operating System: OSX Lion\r\nTitanium Studio version: 1.0.6.201110251616", "comment": { "comments": [ { "id": "172114", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Thank you for raising this ticket.\r\n\r\nIf 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.\r\n\r\nThanks in advance.", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-11-10T03:07:38.000+0000", "updated": "2011-11-10T03:07:38.000+0000" }, { "id": "177918", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "DB.remove() is currently an Android-only feature. Please see TIMOB-6969, which requests an equivalent method.\r\n\r\nThanks for bringing my attention to this. I'm closing this now.", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2012-01-03T17:51:19.000+0000", "updated": "2012-01-03T17:51:49.000+0000" }, { "id": "286051", "author": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-12-28T02:04:38.000+0000", "updated": "2013-12-28T02:04:38.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }