{"action":"closed","issue":{"url":"https://api.github.com/repos/grails/grails-data-mapping/issues/705","repository_url":"https://api.github.com/repos/grails/grails-data-mapping","labels_url":"https://api.github.com/repos/grails/grails-data-mapping/issues/705/labels{/name}","comments_url":"https://api.github.com/repos/grails/grails-data-mapping/issues/705/comments","events_url":"https://api.github.com/repos/grails/grails-data-mapping/issues/705/events","html_url":"https://github.com/grails/grails-data-mapping/issues/705","id":149067689,"number":705,"title":"[3.1.5] if any field has 'shared' and 'unique' all fields with this 'shared' will have unique too","user":{"login":"droggo","id":3313302,"avatar_url":"https://avatars.githubusercontent.com/u/3313302?v=3","gravatar_id":"","url":"https://api.github.com/users/droggo","html_url":"https://github.com/droggo","followers_url":"https://api.github.com/users/droggo/followers","following_url":"https://api.github.com/users/droggo/following{/other_user}","gists_url":"https://api.github.com/users/droggo/gists{/gist_id}","starred_url":"https://api.github.com/users/droggo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/droggo/subscriptions","organizations_url":"https://api.github.com/users/droggo/orgs","repos_url":"https://api.github.com/users/droggo/repos","events_url":"https://api.github.com/users/droggo/events{/privacy}","received_events_url":"https://api.github.com/users/droggo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/grails/grails-data-mapping/labels/Blocker","name":"Blocker","color":"e11d21"},{"url":"https://api.github.com/repos/grails/grails-data-mapping/labels/duplicate","name":"duplicate","color":"cccccc"},{"url":"https://api.github.com/repos/grails/grails-data-mapping/labels/hibernate","name":"hibernate","color":"d4c5f9"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/grails/grails-data-mapping/milestones/49","html_url":"https://github.com/grails/grails-data-mapping/milestones/5.0.5","labels_url":"https://api.github.com/repos/grails/grails-data-mapping/milestones/49/labels","id":1645573,"number":49,"title":"5.0.5","description":"","creator":{"login":"graemerocher","id":66626,"avatar_url":"https://avatars.githubusercontent.com/u/66626?v=3","gravatar_id":"","url":"https://api.github.com/users/graemerocher","html_url":"https://github.com/graemerocher","followers_url":"https://api.github.com/users/graemerocher/followers","following_url":"https://api.github.com/users/graemerocher/following{/other_user}","gists_url":"https://api.github.com/users/graemerocher/gists{/gist_id}","starred_url":"https://api.github.com/users/graemerocher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graemerocher/subscriptions","organizations_url":"https://api.github.com/users/graemerocher/orgs","repos_url":"https://api.github.com/users/graemerocher/repos","events_url":"https://api.github.com/users/graemerocher/events{/privacy}","received_events_url":"https://api.github.com/users/graemerocher/received_events","type":"User","site_admin":false},"open_issues":13,"closed_issues":3,"state":"open","created_at":"2016-03-15T13:28:18Z","updated_at":"2016-04-19T09:55:15Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-04-18T07:34:33Z","updated_at":"2016-04-19T09:55:15Z","closed_at":"2016-04-19T09:55:15Z","body":"Having a domain like\r\n```\r\nclass SomeDomain {\r\n\r\n\tString propertyA\r\n\tString propertyB\r\n\r\n    static constraints = {\r\n    \tpropertyA unique: true, shared: 'stringLength'\r\n    \tpropertyB shared: 'stringLength'\r\n    }\r\n}\r\n```\r\nAnd \r\n```\r\ngrails.gorm.default.constraints = {\r\n    stringLength(maxSize: 255)\r\n}\r\n```\r\n\r\n`gradle schemaExport` will generate following ddl:\r\n```\r\n    alter table some_domain \r\n        add constraint UK_fnhkvlpy1gsivtr58a0n1554j unique (propertya);\r\n\r\n    alter table some_domain \r\n        add constraint UK_aj6anjc942x55cyc8e0ip1yt4 unique (propertyb);\r\n```\r\nunique from propertyA is added to shared definition somehow. If either shared or unique is removed from propertyA, propertyB is correctly defined in ddl."}}