-
Notifications
You must be signed in to change notification settings - Fork 51
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
Runner script dropping the existing triggers #74
Comments
Depending on the situation it can be expected. What type of migration were you running, and what state was it in? |
I tried to add a column a column for that table.
MySQL version is 5.7.25 and the table has triggers in it. Modified the runner code like below to add a support for [--preserve-triggers]. From: [Line number in git ]
Like below: [Line number in git ]
This is happening after the column addition in the table and the actual trigger for this table is dropped. The status is failing at |
I'm not sure I follow. When you file a migration, the first thing Shift does is do a dry-run of pt-osc. If there are any existing triggers on the table, that dry-run will fail. Can you confirm that the dry-run is happening? |
Initially it failed in dry-run itself. I have added the Did i modified the code wrongly ? |
Okay, so let me make sure I understand you correctly. You're trying to run a migration on a table that already has triggers on it. Since shift fails on the dry-run step if a table has triggers, you patched shift to add the |
Yes exactly the same
|
To answer your original question, yes, that is the expected behavior, because shift was never intended to operate on tables that have preexisting triggers on them. If we want to make it safe to run on such tables we'd need to add the |
The runner script has dropped the old triggers for the table.
Logs:
is that expected behavior ?
The text was updated successfully, but these errors were encountered: