{ "id": "107952", "key": "ALOY-467", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "14771", "description": "Alloy 0.3.5", "name": "Alloy 0.3.5", "archived": false, "released": true, "releaseDate": "2013-01-18" }, { "id": "14871", "description": "2013 Sprint 02", "name": "2013 Sprint 02", "archived": true, "released": true, "releaseDate": "2013-01-28" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-08-06T06:24:55.000+0000", "created": "2013-01-16T11:37:54.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "qe-Alloy", "qe-manualtest" ], "versions": [], "issuelinks": [], "assignee": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-08-06T06:24:55.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": "12329", "name": "Runtime", "description": "Generic bucket for uncategorized runtime issues" } ], "description": "The Backbone idAttribute property, which determines which backend property is the unique identifier for a Backbone model, should be assignable through the model.js config.definition object. That way Alloy can automatically apply that idAttribute to all created models. It will also signal Alloy to *_not_* create an additional \"id\" field like it does now for uniquely identifying records. Alloy should only create an additional id row if absolutely necessary and this will allow the developers to prevent that.\r\n\r\nh2. sample\r\n\r\nThis sample will tell Alloy (and Backbone) to use *myId* as the idAttribute for all models created from this definition. It will additionally tell Alloy to *_not_* create an additional id field for uniquely identifying records. If we were to remove the *idAttribute* property, then Alloy would in fact create an id column.\r\n\r\n{code:javascript}\r\nexports.definition = {\r\n\tconfig: {\r\n\t\t\"columns\": {\r\n\t\t\t\"name\":\"TEXT\",\r\n\t\t\t\"nickname\":\"TEXT\",\r\n\t\t\t\"myId\": \"INTEGER PRIMARY KEY AUTOINCREMENT\"\r\n\t\t},\r\n\t\t\"adapter\": {\r\n\t\t\t\"type\": \"sql\",\r\n\t\t\t\"collection_name\": \"fighters\",\r\n\t\t},\r\n\t\t\"idAttribute\": \"myId\"\r\n\t}\r\n}\r\n{code}", "attachment": [], "flagged": false, "summary": "idAttribute assignable from Model config", "creator": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "234860", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Present in this test app: https://github.com/appcelerator/alloy/tree/master/test/apps/models/sql_keywords", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-17T20:03:38.000+0000", "updated": "2013-01-17T20:03:38.000+0000" }, { "id": "236072", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed also on 1_0_X master branch\r\nandroid device: 4.2\r\niPhone devices: iPhone 6 and iPad 4.3.5\r\nTiSDK: 3.0.2.v20130124164131\r\nCLI: 3.0.23\r\n\r\nClosing.", "updateAuthor": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-26T00:18:02.000+0000", "updated": "2013-01-26T00:18:02.000+0000" }, { "id": "236079", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening for adding labels", "updateAuthor": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-26T00:36:45.000+0000", "updated": "2013-01-26T00:36:45.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }