{ "id": "161086", "key": "AC-3847", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2016-06-21T18:38:42.000+0000", "created": "2016-06-14T22:53:20.000+0000", "labels": [ "migration", "model", "sqlite" ], "versions": [], "issuelinks": [ { "id": "52036", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "outwardIssue": { "id": "144814", "key": "AC-1141", "fields": { "summary": "Migration partially applied", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-06-21T18:38:42.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": "14544", "name": "Alloy", "description": "Please enter tickets related to the Alloy here." } ], "description": "I had a migration using:\r\n\r\n{code:javascript}\r\nmigration.up = function(migrator) {\r\n migrator.db.execute('ALTER TABLE ' + migrator.table + ' ADD COLUMN new_col INT;');\r\n};\r\n{code}\r\n\r\nThis successfully adds the new column to the sqlite database, however models basedon the table can not be manipulated.\r\n\r\nFor example\r\n\r\n{code}\r\nvar Model = Alloy.createModel('mymodel');\r\nModel.fetch({id: chat.from.id});\r\nModel.set({\r\n \"new_col\": 1\r\n});\r\nModel.save();\r\n{code}\r\n\r\nWill fail", "attachment": [], "flagged": false, "summary": "Migration only applies to the table not the model", "creator": { "name": "ndastur", "key": "ndastur", "displayName": "Neville Dastur", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "ndastur", "key": "ndastur", "displayName": "Neville Dastur", "active": true, "timeZone": "Europe/London" }, "environment": "SDK 5.3.0 GA\r\nAlloy 1.9.0", "comment": { "comments": [ { "id": "388387", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, \r\n\r\nCan you explain a little more about your issue? Please provide separate sample code to test for database and for Alloy model. We will test the sample to reproduce the issue in our environment. Also, Please provide complete steps to follow for successful regeneration. \r\n\r\nRegards,\r\nSharif.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2016-06-15T15:46:39.000+0000", "updated": "2016-06-15T15:46:39.000+0000" }, { "id": "388391", "author": { "name": "ndastur", "key": "ndastur", "displayName": "Neville Dastur", "active": true, "timeZone": "Europe/London" }, "body": "Okay, realised not a bug but rather a documentation problem.\r\n\r\nI haven't tried but I didn't update the backbone model definition which must have been the cause. I think it would be worth adding to the docs to described the migration file but also that the new column need to be added to the Alloy model file", "updateAuthor": { "name": "ndastur", "key": "ndastur", "displayName": "Neville Dastur", "active": true, "timeZone": "Europe/London" }, "created": "2016-06-15T16:18:31.000+0000", "updated": "2016-06-15T16:18:31.000+0000" }, { "id": "388766", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Reference Docs: http://docs.appcelerator.com/platform/latest/#!/guide/Alloy_Backbone_Migration", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2016-06-21T18:37:31.000+0000", "updated": "2016-06-21T18:37:31.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }