[ALOY-447] Alloy Models should have 'autoincrement' option for primary keys
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-01-17T20:02:32.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Alloy 0.3.5, 2013 Sprint 02 |
Components | Runtime |
Labels | alloy |
Reporter | Joel Margolese |
Assignee | Tony Lukasavage |
Created | 2012-12-27T18:30:56.000+0000 |
Updated | 2013-01-29T19:06:48.000+0000 |
Description
update
This will be supported simply, like this:
exports.definition = {
config: {
columns: {
myId: 'INTEGER PRIMARY KEY AUTOINCREMENT',
col2: 'TEXT'
}
},
adapter: {
type: 'sql',
collection_name: 'myTable',
// tells Alloy _not_ to auto create a unique id column and
// to use this column for Backbone syncing instead
idAttribute: 'myId'
}
};
A test app will be available here: https://github.com/appcelerator/alloy/tree/master/test/apps/models/sql_keywords
in use in this test app: https://github.com/appcelerator/alloy/tree/master/test/apps/models/sql_keywords
Verified fixed also on 1_0_X master branch android device: 4.2 iPhone devices: iPhone 6 and iPad 4.3.5 TiSDK: 3.0.2.v20130124164131 CLI: 3.0.23 Closing.