{"action":"created","issue":{"url":"https://api.github.com/repos/go-xorm/xorm/issues/491","repository_url":"https://api.github.com/repos/go-xorm/xorm","labels_url":"https://api.github.com/repos/go-xorm/xorm/issues/491/labels{/name}","comments_url":"https://api.github.com/repos/go-xorm/xorm/issues/491/comments","events_url":"https://api.github.com/repos/go-xorm/xorm/issues/491/events","html_url":"https://github.com/go-xorm/xorm/issues/491","id":188733832,"number":491,"title":"sqlite warning \"Table ... has column PRIMARY but struct has not related field\"","user":{"login":"russtone","id":3396041,"avatar_url":"https://avatars.githubusercontent.com/u/3396041?v=3","gravatar_id":"","url":"https://api.github.com/users/russtone","html_url":"https://github.com/russtone","followers_url":"https://api.github.com/users/russtone/followers","following_url":"https://api.github.com/users/russtone/following{/other_user}","gists_url":"https://api.github.com/users/russtone/gists{/gist_id}","starred_url":"https://api.github.com/users/russtone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/russtone/subscriptions","organizations_url":"https://api.github.com/users/russtone/orgs","repos_url":"https://api.github.com/users/russtone/repos","events_url":"https://api.github.com/users/russtone/events{/privacy}","received_events_url":"https://api.github.com/users/russtone/received_events","type":"User","site_admin":false},"labels":[{"id":375887886,"url":"https://api.github.com/repos/go-xorm/xorm/labels/WaitForTest","name":"WaitForTest","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-11T10:50:30Z","updated_at":"2016-12-13T11:11:46Z","closed_at":null,"body":"Hello!\r\nI have struct a struct with composite primary key:\r\n```go\r\ntype TaskSolution struct {\r\n\tUID     string    `xorm:\"notnull pk UUID 'uid'\"`\r\n\tTID     string    `xorm:\"notnull pk UUID 'tid'\"`\r\n\tCreated time.Time `xorm:\"created\"`\r\n\tUpdated time.Time `xorm:\"updated\"`\r\n}\r\n```\r\nAnd when I use sqlite3 I constantly get warning: `Table task_solution has column PRIMARY but struct has not related field`. \r\nWhat is the problem here?"},"comment":{"url":"https://api.github.com/repos/go-xorm/xorm/issues/comments/266711669","html_url":"https://github.com/go-xorm/xorm/issues/491#issuecomment-266711669","issue_url":"https://api.github.com/repos/go-xorm/xorm/issues/491","id":266711669,"user":{"login":"russtone","id":3396041,"avatar_url":"https://avatars.githubusercontent.com/u/3396041?v=3","gravatar_id":"","url":"https://api.github.com/users/russtone","html_url":"https://github.com/russtone","followers_url":"https://api.github.com/users/russtone/followers","following_url":"https://api.github.com/users/russtone/following{/other_user}","gists_url":"https://api.github.com/users/russtone/gists{/gist_id}","starred_url":"https://api.github.com/users/russtone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/russtone/subscriptions","organizations_url":"https://api.github.com/users/russtone/orgs","repos_url":"https://api.github.com/users/russtone/repos","events_url":"https://api.github.com/users/russtone/events{/privacy}","received_events_url":"https://api.github.com/users/russtone/received_events","type":"User","site_admin":false},"created_at":"2016-12-13T11:11:46Z","updated_at":"2016-12-13T11:11:46Z","body":"It seems that warnings appears only if database is already exists.\r\nI can reproduce it with this code:\r\n```go\r\npackage main\r\n\r\nimport (\r\n\t\"time\"\r\n\r\n\t\"github.com/go-xorm/xorm\"\r\n\t_ \"github.com/mattn/go-sqlite3\"\r\n)\r\n\r\ntype TaskSolution struct {\r\n\tUID     string    `xorm:\"notnull pk UUID 'uid'\"`\r\n\tTID     string    `xorm:\"notnull pk UUID 'tid'\"`\r\n\tCreated time.Time `xorm:\"created\"`\r\n\tUpdated time.Time `xorm:\"updated\"`\r\n}\r\n\r\nfunc main() {\r\n\tengine, err := xorm.NewEngine(\"sqlite3\", \"./db\")\r\n\tif err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n\tengine.ShowSQL(true)\r\n\r\n\terr = engine.Sync2(new(TaskSolution))\r\n\r\n\tif err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n}\r\n```\r\nAfter second run I got:\r\n\r\n```\r\n[xorm] [info]  2016/12/13 14:09:08.513900 [sql]SELECT name FROM sqlite_master WHERE type='table'\r\n[xorm] [info]  2016/12/13 14:09:08.514864 [sql]SELECT sql FROM sqlite_master WHEREtype='table' and name = ?[task_solution]\r\n[xorm] [info]  2016/12/13 14:09:08.515012 [sql]SELECT sql FROM sqlite_master WHEREtype='index' and tbl_name = ?[task_solution]\r\n[xorm] [warn]  2016/12/13 14:09:08.515116 Table task_solution has column PRIMARY but struct has not related field\r\n```"}}
{"actor":{"display_login":"russtone"}}