{"action":"created","issue":{"url":"https://api.github.com/repos/typeorm/typeorm/issues/549","repository_url":"https://api.github.com/repos/typeorm/typeorm","labels_url":"https://api.github.com/repos/typeorm/typeorm/issues/549/labels{/name}","comments_url":"https://api.github.com/repos/typeorm/typeorm/issues/549/comments","events_url":"https://api.github.com/repos/typeorm/typeorm/issues/549/events","html_url":"https://github.com/typeorm/typeorm/issues/549","id":236453778,"number":549,"title":"Unique Index Name on recreation","user":{"login":"raceloop","id":20871336,"avatar_url":"https://avatars3.githubusercontent.com/u/20871336?v=4","gravatar_id":"","url":"https://api.github.com/users/raceloop","html_url":"https://github.com/raceloop","followers_url":"https://api.github.com/users/raceloop/followers","following_url":"https://api.github.com/users/raceloop/following{/other_user}","gists_url":"https://api.github.com/users/raceloop/gists{/gist_id}","starred_url":"https://api.github.com/users/raceloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raceloop/subscriptions","organizations_url":"https://api.github.com/users/raceloop/orgs","repos_url":"https://api.github.com/users/raceloop/repos","events_url":"https://api.github.com/users/raceloop/events{/privacy}","received_events_url":"https://api.github.com/users/raceloop/received_events","type":"User","site_admin":false},"labels":[{"id":628531686,"url":"https://api.github.com/repos/typeorm/typeorm/labels/comp:%20indices","name":"comp: indices","color":"1d76db","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-16T11:15:13Z","updated_at":"2017-09-11T20:15:44Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nWhen using a unique index like this`@Index({ unique: true })` the column is successfully created but when restarting TORM it throws an error complaining that the index does not exist.\r\n\r\nThe fix is `@Index(\"myCol\", { unique: true })`\r\n\r\nWhat appears to be happening is that the \"ALTER TABLE / DROP INDEX\" statement is no recognising the index by it's uid. Instead it tries to drop the index using the column Name for the index name. \r\n\r\n`ALTER TABLE `user` DROP INDEX myCol`\r\n\r\ninstead of\r\n\r\n`ALTER TABLE `user` DROP INDEX ind_705816b51e5f6f664aacaa94a75`\r\n\r\nAn alternative fix is to simply restart TORM again.\r\n\r\ncheers\r\n\r\nJT\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/typeorm/typeorm/issues/comments/328645761","html_url":"https://github.com/typeorm/typeorm/issues/549#issuecomment-328645761","issue_url":"https://api.github.com/repos/typeorm/typeorm/issues/549","id":328645761,"user":{"login":"iz-iznogood","id":4215960,"avatar_url":"https://avatars1.githubusercontent.com/u/4215960?v=4","gravatar_id":"","url":"https://api.github.com/users/iz-iznogood","html_url":"https://github.com/iz-iznogood","followers_url":"https://api.github.com/users/iz-iznogood/followers","following_url":"https://api.github.com/users/iz-iznogood/following{/other_user}","gists_url":"https://api.github.com/users/iz-iznogood/gists{/gist_id}","starred_url":"https://api.github.com/users/iz-iznogood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iz-iznogood/subscriptions","organizations_url":"https://api.github.com/users/iz-iznogood/orgs","repos_url":"https://api.github.com/users/iz-iznogood/repos","events_url":"https://api.github.com/users/iz-iznogood/events{/privacy}","received_events_url":"https://api.github.com/users/iz-iznogood/received_events","type":"User","site_admin":false},"created_at":"2017-09-11T20:15:44Z","updated_at":"2017-09-11T20:15:44Z","author_association":"CONTRIBUTOR","body":"I can no longer reproduce this in mssql and postgres but it is present in mysql driver."}}
{"actor":{"display_login":"iz-iznogood"}}