{"action":"created","issue":{"url":"https://api.github.com/repos/datamapper/dm-core/issues/281","labels_url":"https://api.github.com/repos/datamapper/dm-core/issues/281/labels{/name}","comments_url":"https://api.github.com/repos/datamapper/dm-core/issues/281/comments","events_url":"https://api.github.com/repos/datamapper/dm-core/issues/281/events","html_url":"https://github.com/datamapper/dm-core/issues/281","id":68067925,"number":281,"title":"Bug on create unique index with scopes","user":{"login":"J-F-Liu","id":1472963,"avatar_url":"https://avatars.githubusercontent.com/u/1472963?v=3","gravatar_id":"","url":"https://api.github.com/users/J-F-Liu","html_url":"https://github.com/J-F-Liu","followers_url":"https://api.github.com/users/J-F-Liu/followers","following_url":"https://api.github.com/users/J-F-Liu/following{/other_user}","gists_url":"https://api.github.com/users/J-F-Liu/gists{/gist_id}","starred_url":"https://api.github.com/users/J-F-Liu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/J-F-Liu/subscriptions","organizations_url":"https://api.github.com/users/J-F-Liu/orgs","repos_url":"https://api.github.com/users/J-F-Liu/repos","events_url":"https://api.github.com/users/J-F-Liu/events{/privacy}","received_events_url":"https://api.github.com/users/J-F-Liu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-13T10:55:12Z","updated_at":"2015-04-13T12:50:24Z","closed_at":null,"body":"For the following code:\r\n`property :modelnumber, String, :unique => [:brand, :name], :required => true`\r\n\r\nThe generated SQL statement is:\r\n~~~~~~~\r\nCREATE UNIQUE INDEX \"unique_products_brand\" ON \"products\" (\"modelnumber\");\r\nCREATE UNIQUE INDEX \"unique_products_name\" ON \"products\" (\"modelnumber\");\r\n~~~~~~~\r\nThe correct SQL statement should be:\r\n`CREATE UNIQUE INDEX \"unique_products_modelnumber\" ON \"products\" (\"modelnumber\", \"brand\", \"name\")`"},"comment":{"url":"https://api.github.com/repos/datamapper/dm-core/issues/comments/92341011","html_url":"https://github.com/datamapper/dm-core/issues/281#issuecomment-92341011","issue_url":"https://api.github.com/repos/datamapper/dm-core/issues/281","id":92341011,"user":{"login":"J-F-Liu","id":1472963,"avatar_url":"https://avatars.githubusercontent.com/u/1472963?v=3","gravatar_id":"","url":"https://api.github.com/users/J-F-Liu","html_url":"https://github.com/J-F-Liu","followers_url":"https://api.github.com/users/J-F-Liu/followers","following_url":"https://api.github.com/users/J-F-Liu/following{/other_user}","gists_url":"https://api.github.com/users/J-F-Liu/gists{/gist_id}","starred_url":"https://api.github.com/users/J-F-Liu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/J-F-Liu/subscriptions","organizations_url":"https://api.github.com/users/J-F-Liu/orgs","repos_url":"https://api.github.com/users/J-F-Liu/repos","events_url":"https://api.github.com/users/J-F-Liu/events{/privacy}","received_events_url":"https://api.github.com/users/J-F-Liu/received_events","type":"User","site_admin":false},"created_at":"2015-04-13T12:50:24Z","updated_at":"2015-04-13T12:50:24Z","body":"The validation works if I first create the table then add the unique argument.\r\nI created a fix on property_set.rb and passed test on table creation, will send PR later."}}