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

Clean on DB2 does not clean triggers. #802

Closed
pauxus opened this issue Jul 16, 2014 · 3 comments
Closed

Clean on DB2 does not clean triggers. #802

pauxus opened this issue Jul 16, 2014 · 3 comments

Comments

@pauxus
Copy link
Contributor

@pauxus pauxus commented Jul 16, 2014

When running clean on a DB2 schema, triggers are not cleaned. I will provide a pull request.

pauxus pushed a commit to pauxus/flyway that referenced this issue Jul 16, 2014
@pauxus
Copy link
Contributor Author

@pauxus pauxus commented Jul 16, 2014

seems to be related to #462. However, this does not only happen in Oracle Comp mode.

Using Flyway 3.0 btw.

In our case we move a table to another tablespace (using sysproc.admin_move_table) and in a later migration create an alter trigger on a table that is dependent on the moved one. This trigger inserts values in a table created in a later migration (between move and trigger creation).

First try, everything works fine.
After "clean migrate", the moving of the table fails (with a wrong error message by DB2, something about wrong state). Took me a while to find out that the move causes entries of the table containing the trigger to change, which triggers the trigger, which tries to insert values into a table not yet existant, which result in a misleading error message by DB2.

Actually, I think this could also be considered a bug in DB2 because one would assume that droping a table should also drop all triggers on that table.

@pauxus
Copy link
Contributor Author

@pauxus pauxus commented Jul 21, 2014

Also not comments on #485, which is related.

axelfontaine added a commit that referenced this issue Oct 14, 2014
#802: DB2 did not drop triggers on clean
@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Oct 14, 2014

Thank you very much for the issue and the pull request. I don't know why my initial tests failed to reproduce this.

Merged and will be part of Flyway 3.1 due out later this month.

I've also added you to the hall of fame page. (flyway 3.1 branch until merged)

Cheers
Axel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants