{"action":"created","issue":{"url":"https://api.github.com/repos/jinzhu/gorm/issues/450","repository_url":"https://api.github.com/repos/jinzhu/gorm","labels_url":"https://api.github.com/repos/jinzhu/gorm/issues/450/labels{/name}","comments_url":"https://api.github.com/repos/jinzhu/gorm/issues/450/comments","events_url":"https://api.github.com/repos/jinzhu/gorm/issues/450/events","html_url":"https://github.com/jinzhu/gorm/issues/450","id":68062252,"number":450,"title":"AutoMigrate foreign keys","user":{"login":"nkovacs","id":2269242,"avatar_url":"https://avatars1.githubusercontent.com/u/2269242?v=4","gravatar_id":"","url":"https://api.github.com/users/nkovacs","html_url":"https://github.com/nkovacs","followers_url":"https://api.github.com/users/nkovacs/followers","following_url":"https://api.github.com/users/nkovacs/following{/other_user}","gists_url":"https://api.github.com/users/nkovacs/gists{/gist_id}","starred_url":"https://api.github.com/users/nkovacs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkovacs/subscriptions","organizations_url":"https://api.github.com/users/nkovacs/orgs","repos_url":"https://api.github.com/users/nkovacs/repos","events_url":"https://api.github.com/users/nkovacs/events{/privacy}","received_events_url":"https://api.github.com/users/nkovacs/received_events","type":"User","site_admin":false},"labels":[{"id":62593834,"url":"https://api.github.com/repos/jinzhu/gorm/labels/type:feature","name":"type:feature","color":"84b6eb","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":32,"created_at":"2015-04-13T10:19:52Z","updated_at":"2018-02-11T22:13:34Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"How do I create foreign keys with AutoMigrate?\n\n``` go\ntype TestRun struct {\n    ID        uint64\n    StartedAt int64\n    EndedAt   int64\n    Suites    []Suite\n}\n\ntype Suite struct {\n    ID        uint64\n    TestRunID uint64\n    Name      string\n}\n\ndb.AutoMigrate(&TestRun{}, &Suite{})\n```\n"},"comment":{"url":"https://api.github.com/repos/jinzhu/gorm/issues/comments/364794349","html_url":"https://github.com/jinzhu/gorm/issues/450#issuecomment-364794349","issue_url":"https://api.github.com/repos/jinzhu/gorm/issues/450","id":364794349,"user":{"login":"zignd","id":3194806,"avatar_url":"https://avatars2.githubusercontent.com/u/3194806?v=4","gravatar_id":"","url":"https://api.github.com/users/zignd","html_url":"https://github.com/zignd","followers_url":"https://api.github.com/users/zignd/followers","following_url":"https://api.github.com/users/zignd/following{/other_user}","gists_url":"https://api.github.com/users/zignd/gists{/gist_id}","starred_url":"https://api.github.com/users/zignd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zignd/subscriptions","organizations_url":"https://api.github.com/users/zignd/orgs","repos_url":"https://api.github.com/users/zignd/repos","events_url":"https://api.github.com/users/zignd/events{/privacy}","received_events_url":"https://api.github.com/users/zignd/received_events","type":"User","site_admin":false},"created_at":"2018-02-11T22:13:34Z","updated_at":"2018-02-11T22:13:34Z","author_association":"NONE","body":"For now [github.com/mattes/migrate](https://github.com/mattes/migrate) is working fine for me. I'm just mentioning it here for those of you looking for an alternative solution, as GORM still doesn't have this feature built-in."}}
{"actor":{"display_login":"zignd"}}