{"action":"created","issue":{"url":"https://api.github.com/repos/trystant/drywall/issues/6","labels_url":"https://api.github.com/repos/trystant/drywall/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/trystant/drywall/issues/6/comments","events_url":"https://api.github.com/repos/trystant/drywall/issues/6/events","html_url":"https://github.com/trystant/drywall/issues/6","id":103973201,"number":6,"title":"Fixture files need to be created for the install process and the initial admin user","user":{"login":"trystant","id":13509,"avatar_url":"https://avatars.githubusercontent.com/u/13509?v=3","gravatar_id":"","url":"https://api.github.com/users/trystant","html_url":"https://github.com/trystant","followers_url":"https://api.github.com/users/trystant/followers","following_url":"https://api.github.com/users/trystant/following{/other_user}","gists_url":"https://api.github.com/users/trystant/gists{/gist_id}","starred_url":"https://api.github.com/users/trystant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trystant/subscriptions","organizations_url":"https://api.github.com/users/trystant/orgs","repos_url":"https://api.github.com/users/trystant/repos","events_url":"https://api.github.com/users/trystant/events{/privacy}","received_events_url":"https://api.github.com/users/trystant/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/trystant/drywall/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/trystant/drywall/labels/technical%20debt","name":"technical debt","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-31T02:13:18Z","updated_at":"2015-09-04T06:24:46Z","closed_at":null,"body":"The current install process includes creating an admin user in the database and then going through the \"forgot password\" section in order to create the first user. There should be an easier way to start things up. One piece of that includes creating a fixture file(s) in order to handle that request. The following code\r\n\r\n```javascript\r\ndb.admingroups.insert({ _id: 'root', name: 'Root' });\r\ndb.admins.insert({ name: {first: 'Root', last: 'Admin', full: 'Root Admin'}, groups: ['root'] });\r\nvar rootAdmin = db.admins.findOne();\r\ndb.users.save({ username: 'root', isActive: 'yes', email: 'your@email.addy', roles: {admin: rootAdmin._id} });\r\nvar rootUser = db.users.findOne();\r\nrootAdmin.user = { id: rootUser._id, name: rootUser.username };\r\ndb.admins.save(rootAdmin);\r\n```\r\n\r\nneeds to be turned into a JSON fixture used by [sequelize-fixtures](https://github.com/domasx2/sequelize-fixtures)"},"comment":{"url":"https://api.github.com/repos/trystant/drywall/issues/comments/137657628","html_url":"https://github.com/trystant/drywall/issues/6#issuecomment-137657628","issue_url":"https://api.github.com/repos/trystant/drywall/issues/6","id":137657628,"user":{"login":"trystant","id":13509,"avatar_url":"https://avatars.githubusercontent.com/u/13509?v=3","gravatar_id":"","url":"https://api.github.com/users/trystant","html_url":"https://github.com/trystant","followers_url":"https://api.github.com/users/trystant/followers","following_url":"https://api.github.com/users/trystant/following{/other_user}","gists_url":"https://api.github.com/users/trystant/gists{/gist_id}","starred_url":"https://api.github.com/users/trystant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trystant/subscriptions","organizations_url":"https://api.github.com/users/trystant/orgs","repos_url":"https://api.github.com/users/trystant/repos","events_url":"https://api.github.com/users/trystant/events{/privacy}","received_events_url":"https://api.github.com/users/trystant/received_events","type":"User","site_admin":false},"created_at":"2015-09-04T06:24:46Z","updated_at":"2015-09-04T06:24:46Z","body":"I've been working on this task, and have run into an error when running the `database/load_initial_data.js` program as follows:\r\n\r\n`> node database/load_initial_data.js`\r\n\r\nThis resulted in the following error:\r\n\r\n````\r\nUnhandled rejection TypeError: Cannot read property 'id' of null\r\n    at null.<anonymous> (/Users/mnyon/code/drywall/node_modules/sequelize-fixtures/lib/loader.js:118:55)\r\n    at tryCatcher (/Users/mnyon/code/drywall/node_modules/sequelize/node_modules/bluebird/js/main/util.js:24:31)\r\n    at Promise._settlePromiseFromHandler (/Users/mnyon/code/drywall/node_modules/sequelize/node_modules/bluebird/js/main/promise.js:489:31)\r\n    at Promise._settlePromiseAt (/Users/mnyon/code/drywall/node_modules/sequelize/node_modules/bluebird/js/main/promise.js:565:18)\r\n    at Async._drainQueue (/Users/mnyon/code/drywall/node_modules/sequelize/node_modules/bluebird/js/main/async.js:128:12)\r\n    at Async._drainQueues (/Users/mnyon/code/drywall/node_modules/sequelize/node_modules/bluebird/js/main/async.js:133:10)\r\n    at Immediate.Async.drainQueues [as _onImmediate] (/Users/mnyon/code/drywall/node_modules/sequelize/node_modules/bluebird/js/main/async.js:15:14)\r\n    at processImmediate [as _immediateCallback] (timers.js:358:17)\r\n````\r\n\r\nI'm assuming that it has something to do with using property names as opposed to IDs. Research needs to be done in that direction."}}