Titanium JIRA Archive
Alloy (ALOY)

[ALOY-486] sql adapter does not update ID in client-side model when using AUTOINCREMENT

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-08-06T22:00:11.000+0000
Affected Version/sAlloy 1.0.0
Fix Version/sAlloy 1.0.0, 2013 Sprint 02
ComponentsRuntime
Labelsqe-manualtest
ReporterTony Lukasavage
AssigneeTony Lukasavage
Created2013-01-25T12:24:21.000+0000
Updated2014-08-06T22:00:11.000+0000

Description

If a new model is being created that relies on an AUTOINCREMENT id, it is not updated in the client-side model when the INSERT happens. The id doesn't update until the next collection.fetch(), and model.fetch() doesn't work because there's no id to match up to on the client-side. To resolve this issue we should grab the last inserted id after a new model is created and assign it to the model's model.id field, if the idAttribute is not the Alloy default "alloy_id". If it's "alloy_id", then just assign a GUID.

Comments

  1. Federico Casali 2013-02-20

    Alloy: 1.0.1 master TiSDK: 3.1.0.v20130219190219 CLI: 3.0.24 Verified as fixed. Using the 'models/sql_no_migration', added Log info (http://pastie.org/6262111 ) Closing.

JSON Source