{"action":"created","issue":{"url":"https://api.github.com/repos/jinzhu/gorm/issues/594","labels_url":"https://api.github.com/repos/jinzhu/gorm/issues/594/labels{/name}","comments_url":"https://api.github.com/repos/jinzhu/gorm/issues/594/comments","events_url":"https://api.github.com/repos/jinzhu/gorm/issues/594/events","html_url":"https://github.com/jinzhu/gorm/issues/594","id":98721240,"number":594,"title":"Issue with one-to-one relation insert to DB","user":{"login":"majidgolshadi","id":5164297,"avatar_url":"https://avatars.githubusercontent.com/u/5164297?v=3","gravatar_id":"","url":"https://api.github.com/users/majidgolshadi","html_url":"https://github.com/majidgolshadi","followers_url":"https://api.github.com/users/majidgolshadi/followers","following_url":"https://api.github.com/users/majidgolshadi/following{/other_user}","gists_url":"https://api.github.com/users/majidgolshadi/gists{/gist_id}","starred_url":"https://api.github.com/users/majidgolshadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/majidgolshadi/subscriptions","organizations_url":"https://api.github.com/users/majidgolshadi/orgs","repos_url":"https://api.github.com/users/majidgolshadi/repos","events_url":"https://api.github.com/users/majidgolshadi/events{/privacy}","received_events_url":"https://api.github.com/users/majidgolshadi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-03T11:13:11Z","updated_at":"2015-11-08T07:20:24Z","closed_at":null,"body":"Hi\r\nI define two table boxes and containeres like below\r\n```go\r\npackage tables\r\n\r\nimport (\r\n   \"github.com/jinzhu/gorm\"\r\n   \"time\"\r\n)\r\n\r\ntype Box struct {\r\n\tgorm.Model\r\n\r\n\tName        string    `sql:\"not null;unique\"`\r\n\tRepo        string    `sql:\"type:varchar(255);\"`\r\n\tPathspec    string    `sql:\"type:varchar(255);not null\"`\r\n\tContainer   Container // One-To-One relationship (has one)\r\n\tContainerID string\r\n}\r\n\r\ntype Container struct {\r\n\tID        string `gorm:\"primary_key\" sql:\"type:varchar(64)\"`\r\n\tCreatedAt time.Time\r\n\tUpdatedAt time.Time\r\n\tDeletedAt *time.Time\r\n\r\n\tImage   string `sql:\"type:varchar(255);not null\"`\r\n\tStatus  string `sql:\"type:varchar(255);not null\"`\r\n}\r\n```\r\nwhen i try to insert this struct\r\n```go\r\nboxRow := &tables.Box{\r\n\t\t\tName: box.Name,\r\n\t\t\tRepo: box.Git.Repo,\r\n\t\t\tPathspec: box.Git.PathSpec,\r\n\t\t\tContainer: tables.Container{\r\n\t\t\t\tID: container.ID,\r\n\t\t\t\tImage: container.Image,\r\n\t\t\t\tStatus: \"create\",\r\n\t\t\t},\r\n\t\t}\r\n\r\n\t\tdb.Connect()\r\n\t\tdb.DbConnection.Create(boxRow)\r\n```\r\nOnly **box row** inserted in table but **container row** does not insert in containers table and i got no Error!\r\nWhy this happen and how can i solve that?"},"comment":{"url":"https://api.github.com/repos/jinzhu/gorm/issues/comments/154780967","html_url":"https://github.com/jinzhu/gorm/issues/594#issuecomment-154780967","issue_url":"https://api.github.com/repos/jinzhu/gorm/issues/594","id":154780967,"user":{"login":"azer","id":13072,"avatar_url":"https://avatars.githubusercontent.com/u/13072?v=3","gravatar_id":"","url":"https://api.github.com/users/azer","html_url":"https://github.com/azer","followers_url":"https://api.github.com/users/azer/followers","following_url":"https://api.github.com/users/azer/following{/other_user}","gists_url":"https://api.github.com/users/azer/gists{/gist_id}","starred_url":"https://api.github.com/users/azer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azer/subscriptions","organizations_url":"https://api.github.com/users/azer/orgs","repos_url":"https://api.github.com/users/azer/repos","events_url":"https://api.github.com/users/azer/events{/privacy}","received_events_url":"https://api.github.com/users/azer/received_events","type":"User","site_admin":false},"created_at":"2015-11-08T07:20:24Z","updated_at":"2015-11-08T07:20:24Z","body":"I have the same issue, any ideas ?"}}