{"action":"created","issue":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/5049","labels_url":"https://api.github.com/repos/sequelize/sequelize/issues/5049/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/5049/comments","events_url":"https://api.github.com/repos/sequelize/sequelize/issues/5049/events","html_url":"https://github.com/sequelize/sequelize/issues/5049","id":122317248,"number":5049,"title":"Error when creating non-association constraint on table in different schema","user":{"login":"Askelkana","id":672821,"avatar_url":"https://avatars.githubusercontent.com/u/672821?v=3","gravatar_id":"","url":"https://api.github.com/users/Askelkana","html_url":"https://github.com/Askelkana","followers_url":"https://api.github.com/users/Askelkana/followers","following_url":"https://api.github.com/users/Askelkana/following{/other_user}","gists_url":"https://api.github.com/users/Askelkana/gists{/gist_id}","starred_url":"https://api.github.com/users/Askelkana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Askelkana/subscriptions","organizations_url":"https://api.github.com/users/Askelkana/orgs","repos_url":"https://api.github.com/users/Askelkana/repos","events_url":"https://api.github.com/users/Askelkana/events{/privacy}","received_events_url":"https://api.github.com/users/Askelkana/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sequelize/sequelize/labels/bug","name":"bug","color":"d7e102"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":25,"created_at":"2015-12-15T16:56:00Z","updated_at":"2015-12-16T08:51:54Z","closed_at":null,"body":"Dialect: mysql\r\n\r\nWhen specifying a foreign key constraint that references a table in another schema, the correct format is:\r\n\r\nFOREIGN KEY (\\`tableId\\`) REFERENCES __Schema.Table__ (\\`id\\`) ON DELETE CASCADE ON UPDATE CASCADE\r\n\r\nwhereas what is generated is:\r\n\r\nFOREIGN KEY (\\`tableId\\`) REFERENCES __\\`Table\\`__ (\\`id\\`) ON DELETE CASCADE ON UPDATE CASCADE\r\n\r\n(the difference is (a) the absence of the Schema name and (b) the presence of the tick marks)\r\n\r\nThis results even if specifying the model in the reference map, i.e.\r\n\r\n    references: { model: Schema.Table }\r\n\r\nI have played around with other documented variations of the \"references\" option, but all produce this latter result, which fails to factor in the schema, and adds the tick marks which need to be removed.\r\n\r\nUnless, of course, there exists a correct way to specify this relationship, that I'm missing...\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/comments/165035905","html_url":"https://github.com/sequelize/sequelize/issues/5049#issuecomment-165035905","issue_url":"https://api.github.com/repos/sequelize/sequelize/issues/5049","id":165035905,"user":{"login":"janmeier","id":1210224,"avatar_url":"https://avatars.githubusercontent.com/u/1210224?v=3","gravatar_id":"","url":"https://api.github.com/users/janmeier","html_url":"https://github.com/janmeier","followers_url":"https://api.github.com/users/janmeier/followers","following_url":"https://api.github.com/users/janmeier/following{/other_user}","gists_url":"https://api.github.com/users/janmeier/gists{/gist_id}","starred_url":"https://api.github.com/users/janmeier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janmeier/subscriptions","organizations_url":"https://api.github.com/users/janmeier/orgs","repos_url":"https://api.github.com/users/janmeier/repos","events_url":"https://api.github.com/users/janmeier/events{/privacy}","received_events_url":"https://api.github.com/users/janmeier/received_events","type":"User","site_admin":false},"created_at":"2015-12-16T08:51:54Z","updated_at":"2015-12-16T08:51:54Z","body":"See https://github.com/sequelize/sequelize/issues/3023"}}