Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tables that get renamed #12

Open
noplanman opened this issue Mar 28, 2017 · 1 comment
Open

Tables that get renamed #12

noplanman opened this issue Mar 28, 2017 · 1 comment

Comments

@noplanman
Copy link

As it is now, if the difference between two databases is a renamed table, this library will delete the old and recreate the new one, losing all the data.

It would be great if tables could be renamed in migration scripts.
Auto-detecting this could be difficult, especially if some columns are changed at the same time, but maybe table renames could be passed in the CLI call?

e.g.
$ php-mysql-diff --rename 'table_old:table_new,table2_old:table2_new' ...

I'm busy writing a script that automatically generates all migration scripts for a whole bunch of versions, so having something automated would be really great, instead of having to manually fix a couple of script every time.

Open to any other tips or suggestions on this, thanks!

@camcima
Copy link
Owner

camcima commented Nov 2, 2017

Hi @noplanman , as you've said, it would be very hard to detect tables that were renamed because there wouldn't be any link between them. Your idea of passing it as an argument at the command line might work. Would you be willing to write a PR for this?

@camcima camcima assigned camcima and unassigned camcima Nov 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants