{ "id": "61014", "key": "TIMOB-382", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2011-04-15T02:28:25.000+0000", "created": "2011-04-15T02:28:24.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "database", "ios" ], "versions": [], "issuelinks": [], "assignee": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-09T21:08:44.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "{html}

It'd be great if the install can overwrite the writable sqlite3\ndb file with a given option.

\n

Changes made to the schema of a database change a lot while on\ndevelopment, and it seems that the install method would just use\nthe existing one if it already exists.

\n

Proposed implementation:

\n
\nTitanium.Database.install(resource_name, target_name, options);\n
\n

Where options, for now, has the following options:
\nforce {boolean} Overwrites target name when true.\nDefaults to false.

\n

The following code will use the target_name, not replace\nit:

\n
\nTitanium.Database.install(resource_name, target_name);\nTitanium.Database.install(resource_name, target_name, {});\nTitanium.Database.install(resource_name, target_name, { force: false });\n
\n

The following code will replace target_name with\nresource_name

\n
\nTitanium.Database.install(resource_name, target_name, { force: true });\n
{html}", "attachment": [], "flagged": false, "summary": "Titanium.Database.install Options to Force Rewrite on sql File", "creator": { "name": "dukz", "key": "dukz", "displayName": "dukz", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "dukz", "key": "dukz", "displayName": "dukz", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "123215", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Can be accomplished with a combination of Ti.Database.remove()\nand Ti.Database.install().

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:28:25.000+0000", "updated": "2011-04-15T02:28:25.000+0000" }, { "id": "410502", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-09T21:08:44.000+0000", "updated": "2017-03-09T21:08:44.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }