{"action":"created","issue":{"url":"https://api.github.com/repos/djrobstep/migra/issues/29","repository_url":"https://api.github.com/repos/djrobstep/migra","labels_url":"https://api.github.com/repos/djrobstep/migra/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/djrobstep/migra/issues/29/comments","events_url":"https://api.github.com/repos/djrobstep/migra/issues/29/events","html_url":"https://github.com/djrobstep/migra/issues/29","id":308470025,"number":29,"title":"Support table renames","user":{"login":"exhuma","id":65717,"avatar_url":"https://avatars3.githubusercontent.com/u/65717?v=4","gravatar_id":"","url":"https://api.github.com/users/exhuma","html_url":"https://github.com/exhuma","followers_url":"https://api.github.com/users/exhuma/followers","following_url":"https://api.github.com/users/exhuma/following{/other_user}","gists_url":"https://api.github.com/users/exhuma/gists{/gist_id}","starred_url":"https://api.github.com/users/exhuma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exhuma/subscriptions","organizations_url":"https://api.github.com/users/exhuma/orgs","repos_url":"https://api.github.com/users/exhuma/repos","events_url":"https://api.github.com/users/exhuma/events{/privacy}","received_events_url":"https://api.github.com/users/exhuma/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-26T08:06:30Z","updated_at":"2018-03-27T00:11:17Z","closed_at":null,"author_association":"NONE","body":"migra has no way of detecting table renames. If a table has been renamed, the table as it was before the rename will remain and a new table will be created.\r\n\r\nSuggestion: A safe way to implement this would probably to manually specify the renames via a configuration file (A simple text file with `old_name new_name` lines would suffice). This would also avoid the need of programming a rename detection into `migra`.\r\n\r\n... speaking of which:\r\n\r\n*If* a form of \"rename detection\" is implemented, it should also take into account tables which are not 100% identical. This value could be made configurable. This is not trivial and the simple config-file approach is sufficient."},"comment":{"url":"https://api.github.com/repos/djrobstep/migra/issues/comments/376352639","html_url":"https://github.com/djrobstep/migra/issues/29#issuecomment-376352639","issue_url":"https://api.github.com/repos/djrobstep/migra/issues/29","id":376352639,"user":{"login":"djrobstep","id":2441221,"avatar_url":"https://avatars0.githubusercontent.com/u/2441221?v=4","gravatar_id":"","url":"https://api.github.com/users/djrobstep","html_url":"https://github.com/djrobstep","followers_url":"https://api.github.com/users/djrobstep/followers","following_url":"https://api.github.com/users/djrobstep/following{/other_user}","gists_url":"https://api.github.com/users/djrobstep/gists{/gist_id}","starred_url":"https://api.github.com/users/djrobstep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djrobstep/subscriptions","organizations_url":"https://api.github.com/users/djrobstep/orgs","repos_url":"https://api.github.com/users/djrobstep/repos","events_url":"https://api.github.com/users/djrobstep/events{/privacy}","received_events_url":"https://api.github.com/users/djrobstep/received_events","type":"User","site_admin":false},"created_at":"2018-03-27T00:11:17Z","updated_at":"2018-03-27T00:11:17Z","author_association":"OWNER","body":"Agree that rename detection would be tricky and prone to error, and is best handled by some kind of old-new mapping, as you suggest.\r\n\r\nNot sure about this aspect:\r\n\r\n> If a table has been renamed, the table as it was before the rename will remain and a new table will be created.\r\n\r\nI'd expect a rename to generate an \"alter table t_old rename to t_new\" statement. Or do you have a different use case in mind?"}}
{"actor":{"display_login":"djrobstep"}}