{"action":"created","issue":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/3064","labels_url":"https://api.github.com/repos/sequelize/sequelize/issues/3064/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/3064/comments","events_url":"https://api.github.com/repos/sequelize/sequelize/issues/3064/events","html_url":"https://github.com/sequelize/sequelize/issues/3064","id":56817915,"number":3064,"title":"Two unique associations","user":{"login":"neoziro","id":266302,"avatar_url":"https://avatars.githubusercontent.com/u/266302?v=3","gravatar_id":"","url":"https://api.github.com/users/neoziro","html_url":"https://github.com/neoziro","followers_url":"https://api.github.com/users/neoziro/followers","following_url":"https://api.github.com/users/neoziro/following{/other_user}","gists_url":"https://api.github.com/users/neoziro/gists{/gist_id}","starred_url":"https://api.github.com/users/neoziro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neoziro/subscriptions","organizations_url":"https://api.github.com/users/neoziro/orgs","repos_url":"https://api.github.com/users/neoziro/repos","events_url":"https://api.github.com/users/neoziro/events{/privacy}","received_events_url":"https://api.github.com/users/neoziro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-06T14:29:40Z","updated_at":"2015-02-09T08:56:12Z","closed_at":null,"body":"I have two associations on a table and I would like to add a unique index for these two associations. Is it possible? How to do it?\r\n\r\n```js\r\nvar Click = sequelize.define('Click', {}, {\r\n    classMethods: {\r\n      associate: function (models) {\r\n        Click.belongsTo(models.Notification);\r\n        Click.belongsTo(models.User);\r\n      }\r\n    }\r\n  });\r\n```\r\n\r\nI want the couple notification / user to be unique.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/comments/73475504","html_url":"https://github.com/sequelize/sequelize/issues/3064#issuecomment-73475504","issue_url":"https://api.github.com/repos/sequelize/sequelize/issues/3064","id":73475504,"user":{"login":"mickhansen","id":699049,"avatar_url":"https://avatars.githubusercontent.com/u/699049?v=3","gravatar_id":"","url":"https://api.github.com/users/mickhansen","html_url":"https://github.com/mickhansen","followers_url":"https://api.github.com/users/mickhansen/followers","following_url":"https://api.github.com/users/mickhansen/following{/other_user}","gists_url":"https://api.github.com/users/mickhansen/gists{/gist_id}","starred_url":"https://api.github.com/users/mickhansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mickhansen/subscriptions","organizations_url":"https://api.github.com/users/mickhansen/orgs","repos_url":"https://api.github.com/users/mickhansen/repos","events_url":"https://api.github.com/users/mickhansen/events{/privacy}","received_events_url":"https://api.github.com/users/mickhansen/received_events","type":"User","site_admin":false},"created_at":"2015-02-09T08:56:12Z","updated_at":"2015-02-09T08:56:12Z","body":"@janmeier yeah that could probably be doable, have to reset unique and primary key holders too tho."}}