{"action":"opened","issue":{"url":"https://api.github.com/repos/tgriesser/bookshelf/issues/587","labels_url":"https://api.github.com/repos/tgriesser/bookshelf/issues/587/labels{/name}","comments_url":"https://api.github.com/repos/tgriesser/bookshelf/issues/587/comments","events_url":"https://api.github.com/repos/tgriesser/bookshelf/issues/587/events","html_url":"https://github.com/tgriesser/bookshelf/issues/587","id":55055544,"number":587,"title":"Auto-update timestamps on insert in seed file","user":{"login":"demisx","id":4452412,"avatar_url":"https://avatars.githubusercontent.com/u/4452412?v=3","gravatar_id":"","url":"https://api.github.com/users/demisx","html_url":"https://github.com/demisx","followers_url":"https://api.github.com/users/demisx/followers","following_url":"https://api.github.com/users/demisx/following{/other_user}","gists_url":"https://api.github.com/users/demisx/gists{/gist_id}","starred_url":"https://api.github.com/users/demisx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demisx/subscriptions","organizations_url":"https://api.github.com/users/demisx/orgs","repos_url":"https://api.github.com/users/demisx/repos","events_url":"https://api.github.com/users/demisx/events{/privacy}","received_events_url":"https://api.github.com/users/demisx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-21T18:12:18Z","updated_at":"2015-01-21T18:12:18Z","closed_at":null,"body":"Hi. I have a `Section` model defined as:\r\n\r\n```js\r\n// base-model.js\r\nbase.Model = baseBookshelf.Model.extend({\r\n  hasTimestamps: true\r\n});\r\nmodule.exports = base;\r\n```\r\n\r\n```js\r\n// section-model.js\r\nvar Section = base.Model.extend({\r\n  tableName: 'sections',\r\n  classifieds: function() {\r\n    return this.belongsToMany('Classified');\r\n  }\r\n});\r\n\r\nmodule.exports = {\r\n  Section: base.model('Section', Section)\r\n};\r\n```\r\n\r\nRunning this seed below doesn't populate the `created_at` and `updated_at` fields in the `sections` database. I know I can set them manually in the seed file, but would like to stay DRY and have these fields updated automatically. Is this possible in Bookshelf?\r\n\r\n```js\r\nexports.seed = function(knex, Promise) {\r\n  return knex('sections').insert([\r\n    { id: 1, code: 'cdc' },\r\n    { id: 2, code: 'psd' },\r\n    { id: 3, code: 'for' }\r\n  ]);\r\n};\r\n```"}}