Titanium JIRA Archive
Alloy (ALOY)

[ALOY-447] Alloy Models should have 'autoincrement' option for primary keys

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2013-01-17T20:02:32.000+0000
Affected Version/sn/a
Fix Version/sAlloy 0.3.5, 2013 Sprint 02
ComponentsRuntime
Labelsalloy
ReporterJoel Margolese
AssigneeTony Lukasavage
Created2012-12-27T18:30:56.000+0000
Updated2013-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

Problem

Alloy model column definitions should support "primary autoincrement" attributes to support the creation of unique identifiers for table rows.

Test case

No test case.

Logs

No logs

Discussions

[Q&A reference](http://developer.appcelerator.com/question/146207/relationships-in-alloy-models)

Comments

  1. Tony Lukasavage 2013-01-17

    in use in this test app: https://github.com/appcelerator/alloy/tree/master/test/apps/models/sql_keywords
  2. Federico Casali 2013-01-28

    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.

JSON Source