{"action":"created","issue":{"url":"https://api.github.com/repos/vlucas/spot2/issues/157","repository_url":"https://api.github.com/repos/vlucas/spot2","labels_url":"https://api.github.com/repos/vlucas/spot2/issues/157/labels{/name}","comments_url":"https://api.github.com/repos/vlucas/spot2/issues/157/comments","events_url":"https://api.github.com/repos/vlucas/spot2/issues/157/events","html_url":"https://github.com/vlucas/spot2/pull/157","id":148323712,"number":157,"title":"Patch for empty variable bug #77 #136","user":{"login":"FlipEverything","id":2407139,"avatar_url":"https://avatars.githubusercontent.com/u/2407139?v=3","gravatar_id":"","url":"https://api.github.com/users/FlipEverything","html_url":"https://github.com/FlipEverything","followers_url":"https://api.github.com/users/FlipEverything/followers","following_url":"https://api.github.com/users/FlipEverything/following{/other_user}","gists_url":"https://api.github.com/users/FlipEverything/gists{/gist_id}","starred_url":"https://api.github.com/users/FlipEverything/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FlipEverything/subscriptions","organizations_url":"https://api.github.com/users/FlipEverything/orgs","repos_url":"https://api.github.com/users/FlipEverything/repos","events_url":"https://api.github.com/users/FlipEverything/events{/privacy}","received_events_url":"https://api.github.com/users/FlipEverything/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-04-14T10:55:58Z","updated_at":"2016-04-14T13:55:59Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/vlucas/spot2/pulls/157","html_url":"https://github.com/vlucas/spot2/pull/157","diff_url":"https://github.com/vlucas/spot2/pull/157.diff","patch_url":"https://github.com/vlucas/spot2/pull/157.patch"},"body":"Pull request to patch the addForeignKeys() function added in PR #136 \r\n\r\n**Issue:** The $relations variable is empty and the migration fails. \r\n@Schrank could reproduce the problem.\r\n\r\n**Example Entity:**\r\n```php\r\nclass Example extends \\Spot\\Entity\r\n{\r\n  protected static $table = 'example';\r\n  public static function fields()\r\n  {\r\n    return [\r\n      'id' => ['type' => 'integer', 'primary' => true, 'autoincrement' => true],\r\n      'officeId' => ['type' => 'integer', 'required' => true, 'column' => 'office_id']\r\n    ];\r\n  }\r\n  public static function relations(Mapper $mapper, Entity $entity)\r\n  {\r\n    return [\r\n      'office' => $mapper->belongsTo($entity, 'Rendelo\\Entity\\Office', 'officeId')\r\n    ];\r\n  }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/vlucas/spot2/issues/comments/209954736","html_url":"https://github.com/vlucas/spot2/pull/157#issuecomment-209954736","issue_url":"https://api.github.com/repos/vlucas/spot2/issues/157","id":209954736,"user":{"login":"vlucas","id":187,"avatar_url":"https://avatars.githubusercontent.com/u/187?v=3","gravatar_id":"","url":"https://api.github.com/users/vlucas","html_url":"https://github.com/vlucas","followers_url":"https://api.github.com/users/vlucas/followers","following_url":"https://api.github.com/users/vlucas/following{/other_user}","gists_url":"https://api.github.com/users/vlucas/gists{/gist_id}","starred_url":"https://api.github.com/users/vlucas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vlucas/subscriptions","organizations_url":"https://api.github.com/users/vlucas/orgs","repos_url":"https://api.github.com/users/vlucas/repos","events_url":"https://api.github.com/users/vlucas/events{/privacy}","received_events_url":"https://api.github.com/users/vlucas/received_events","type":"User","site_admin":false},"created_at":"2016-04-14T13:55:59Z","updated_at":"2016-04-14T13:55:59Z","body":"Looks like foreign keys are doing exactly what they are supposed to do. We will have to update that test to add an author first, then use that `id` so the FK constraint passes."}}