{ "id": "113072", "key": "ALOY-634", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2014-03-10T19:13:04.000+0000", "created": "2013-04-18T17:48:59.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "alloy", "database", "models" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-03-07T22:26:05.000+0000", "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" } }, "components": [ { "id": "13605", "name": "Models" }, { "id": "12329", "name": "Runtime", "description": "Generic bucket for uncategorized runtime issues" }, { "id": "12326", "name": "XML", "description": "View XML and parsing" } ], "description": "The current alloy 1.1.0 Models doesn't support creating a Column with a Default value of CURRENT_TIMESTAMP. I've already tested the following configurations:\r\n\r\nNot Working\r\n{code:json}\r\nconfig: {\r\n \"columns\": {\r\n \"date_created\": \"TIMESTAMP\"\r\n },\r\n \"defaults\": {\r\n \"date_created\": \"CURRENT_TIMESTAMP\"\r\n },\r\n \"adapter\": {\r\n \"type\": \"sql\",\r\n \"collection_name\": \"Table1\"\r\n }\r\n}\r\n{code}\r\n\r\nNot Working\r\n{code:json}\r\nconfig: {\r\n \"columns\": {\r\n \"date_created\": \"TIMESTAMP DEFAULT CURRENT_TIMESTAMP\"\r\n },\r\n \"defaults\": {\r\n \r\n },\r\n \"adapter\": {\r\n \"type\": \"sql\",\r\n \"collection_name\": \"Table1\"\r\n }\r\n}\r\n{code}", "attachment": [], "flagged": false, "summary": "Alloy: Create a Model that contains a field/column with a Default value of CURRENT_TIMESTAMP", "creator": { "name": "sabmark", "key": "sabmark", "displayName": "Mark Anthony Sabandal", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "sabmark", "key": "sabmark", "displayName": "Mark Anthony Sabandal", "active": true, "timeZone": "Europe/Berlin" }, "environment": "iOS", "comment": { "comments": [ { "id": "295073", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "Is there a reason you can't do this?\n\n{code}\nexports.definition = {\n config: {\n \"columns\" : {\n \"name\" : \"text\",\n \"date_created\" : \"text\"\n },\n \"defaults\" : {\n \"date_created\": new Date()\n },\n adapter: {\n type: \"sql\",\n collection_name: \"mycollection\"\n }\n }\n{code}", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-02-28T16:50:22.000+0000", "updated": "2014-02-28T16:50:22.000+0000" }, { "id": "296351", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "Marking resolved/won't fix because there's a suitable technique already. Not that SQLite doesn't offer support for datetime-type data types for fields. To simulate these, we'd have to pass through the date and time functions (http://sqlite.org/lang_datefunc.html) which offer no inherent advantage over the JavaScript functions that can be executed directly.", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-03-10T19:13:04.000+0000", "updated": "2014-03-10T19:13:04.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }