Titanium JIRA Archive
Alloy (ALOY)

[ALOY-479] Migration processing bug

GitHub Issuen/a
TypeBug
PriorityHigh
StatusResolved
ResolutionFixed
Resolution Date2013-01-23T16:45:42.000+0000
Affected Version/sAlloy 0.3.6
Fix Version/sAlloy 1.0.0, 2013 Sprint 02
ComponentsRuntime
Labelsn/a
ReporterTony Lukasavage
AssigneeUnknown
Created2013-01-22T14:43:10.000+0000
Updated2018-03-07T22:25:52.000+0000

Description

from Ben Hatfield: Here is the code: https://gist.github.com/4589676 Here are the step to reproduce the two issues:

Make sure line #16 (migration attribute) in models/book.js is commented. Run code as is on the iOS simulator. Application should run OK. Table version should be at version #2. In console output, the collection data should show title, author, alloy_id and isbn (as null).

Uncomment line #16 in models/book.js. Run code. Application should run OK. Table version should be at version 1. Console output should show collection data with only title, author and alloy_id. Isbn field should be gone.

Recomment line #16 and run code. The preloaded data is displayed twice on the simulator. Table version is at version 2 again. --> Table upgrade is OK except duplicate preload data. Seems to be applying version 1 again despite already being at that state previously.

Uncomment line #16 in models/book.js, and uncomment line #16 (dropTable) and comment out line #15 (DROP TABLE + db.name) in migrations/201300182216120_book.js (second version). Run code. Application throws SQL statement error.

Undo changes to migration file. Recomment line #16 and uncomment line #15. Run code. Application should run OK. All data is gone since the migration was interrupted in the previous step. --> dropTable method is not working for this downgrade.

Comments

No comments

JSON Source