{"action":"created","issue":{"url":"https://api.github.com/repos/DoSomething/gladiator/issues/56","repository_url":"https://api.github.com/repos/DoSomething/gladiator","labels_url":"https://api.github.com/repos/DoSomething/gladiator/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/DoSomething/gladiator/issues/56/comments","events_url":"https://api.github.com/repos/DoSomething/gladiator/issues/56/events","html_url":"https://github.com/DoSomething/gladiator/pull/56","id":139298788,"number":56,"title":"DB Restructure","user":{"login":"sbsmith86","id":1700409,"avatar_url":"https://avatars.githubusercontent.com/u/1700409?v=3","gravatar_id":"","url":"https://api.github.com/users/sbsmith86","html_url":"https://github.com/sbsmith86","followers_url":"https://api.github.com/users/sbsmith86/followers","following_url":"https://api.github.com/users/sbsmith86/following{/other_user}","gists_url":"https://api.github.com/users/sbsmith86/gists{/gist_id}","starred_url":"https://api.github.com/users/sbsmith86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbsmith86/subscriptions","organizations_url":"https://api.github.com/users/sbsmith86/orgs","repos_url":"https://api.github.com/users/sbsmith86/repos","events_url":"https://api.github.com/users/sbsmith86/events{/privacy}","received_events_url":"https://api.github.com/users/sbsmith86/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-08T14:58:34Z","updated_at":"2016-03-08T15:19:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/DoSomething/gladiator/pulls/56","html_url":"https://github.com/DoSomething/gladiator/pull/56","diff_url":"https://github.com/DoSomething/gladiator/pull/56.diff","patch_url":"https://github.com/DoSomething/gladiator/pull/56.patch"},"body":"#### What's this PR do?\r\n\r\nUpdates the DB structure in Gladiator as outlined in #45 \r\n\r\n* Removed old migrations, and made new ones. \r\n* Added a new `Contests` table and a model that defined it's relationship to waiting rooms and competitions\r\n* Renamed pivot tables so they get run last. \r\n* Added a new `ContestTableSeeder` that makes 3 contests.\r\n* Added a `ContestServiceProvider` that listens for the `created` event on Contest models and automatically creates a new waiting room for the competition. \r\n* Created a competition seeder that just creates three empty competitions for a Contest.\r\n\r\nNOTES/QUESTIONS -\r\n\r\n* I wasn't sure about the `duration` field. My thought is we can make the decision to always store this as an `integer` representing days and then on the front end we can provide a slicker interface with like units (days, weeks, months, etc) that gets converted into days before it gets stored in the db. But I am open to doing something different. \r\n\r\n* Because of the ^^ open question I didn't implement any fancy calculation of competition start and end date yet. \r\n\r\n* I didn't touch any CRUD stuff or other logic to keep this as small as I could, so we can fix those up in other issues. \r\n\r\n#### How should this be manually tested?\r\n\r\nPull down this branch\r\nRun `composer dump-autoload`\r\nRun `php artisan:refresh` to get new tables\r\nRun `php artisan db:seed` to seed the DB\r\n\r\nReview the DB to make sure all the correct columns are there and the relationships look right.\r\n\r\n#### What are the relevant tickets?\r\n\r\nFixes #45 \r\n\r\n@angaither @deadlybutter @weerd "},"comment":{"url":"https://api.github.com/repos/DoSomething/gladiator/issues/comments/193821342","html_url":"https://github.com/DoSomething/gladiator/pull/56#issuecomment-193821342","issue_url":"https://api.github.com/repos/DoSomething/gladiator/issues/56","id":193821342,"user":{"login":"angaither","id":645205,"avatar_url":"https://avatars.githubusercontent.com/u/645205?v=3","gravatar_id":"","url":"https://api.github.com/users/angaither","html_url":"https://github.com/angaither","followers_url":"https://api.github.com/users/angaither/followers","following_url":"https://api.github.com/users/angaither/following{/other_user}","gists_url":"https://api.github.com/users/angaither/gists{/gist_id}","starred_url":"https://api.github.com/users/angaither/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angaither/subscriptions","organizations_url":"https://api.github.com/users/angaither/orgs","repos_url":"https://api.github.com/users/angaither/repos","events_url":"https://api.github.com/users/angaither/events{/privacy}","received_events_url":"https://api.github.com/users/angaither/received_events","type":"User","site_admin":false},"created_at":"2016-03-08T15:19:19Z","updated_at":"2016-03-08T15:19:19Z","body":"@sbsmith86 ahh, my bad. I thought `duration` on the `contest` was how long the signup period should be open. totally misunderstood that field \r\n"}}