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

flyway:clean fails on db2 when trying to drop versioning on tables which is accessed by a MQT #1649

Closed
msallstr opened this issue May 27, 2017 · 1 comment

Comments

@msallstr
Copy link
Contributor

@msallstr msallstr commented May 27, 2017

What version of Flyway are you using?

4.2.0

Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin, SBT plugin, ANT tasks)

maven plugin

What database are you using (type & version)?

db2 10.5

What operating system are you using?

windows/linux

What did you do?

(Please include the content causing the issue, any relevant configuration settings, and the command you ran)

flyway:clean

What did you expect to see?

[INFO] Successfully dropped schema "TESTSCHEMA" (execution time 00:10.829s)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17.108 s
[INFO] Finished at: 2017-05-27T14:49:59+02:00
[INFO] Final Memory: 28M/407M
[INFO] ------------------------------------------------------------------------

What did you see instead?

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.076 s
[INFO] Finished at: 2017-05-27T14:54:01+02:00
[INFO] Final Memory: 27M/406M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.flywaydb:flyway-maven-plugin:4.2.0:clean (default-cli) on project uppfoljning: org.flywaydb.core.internal.dbsupport.FlywaySqlException:
[ERROR] Unable to clean schema "TESTSCHEMA"
[ERROR] ------------------------------------
[ERROR] SQL State : 42997
[ERROR] Error Code : -270
[ERROR] Message : DB2 SQL Error: SQLCODE=-270, SQLSTATE=42997, SQLERRMC=21, DRIVER=4.19.66
...

SQL State  : 42997
Error Code : -270
Message    : DB2 SQL Error: SQLCODE=-270, SQLSTATE=42997, SQLERRMC=21, DRIVER=4.19.66

        at org.flywaydb.maven.AbstractFlywayMojo.execute(AbstractFlywayMojo.java:602)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        ... 20 more
Caused by: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-270, SQLSTATE=42997, SQLERRMC=21, DRIVER=4.19.66
        at com.ibm.db2.jcc.am.kd.a(kd.java:747)
        at com.ibm.db2.jcc.am.kd.a(kd.java:66)
        at com.ibm.db2.jcc.am.kd.a(kd.java:135)
        at com.ibm.db2.jcc.am.fp.b(fp.java:2439)
        at com.ibm.db2.jcc.am.fp.c(fp.java:2422)
        at com.ibm.db2.jcc.t4.bb.l(bb.java:408)
        at com.ibm.db2.jcc.t4.bb.a(bb.java:62)
        at com.ibm.db2.jcc.t4.p.a(p.java:50)
        at com.ibm.db2.jcc.t4.wb.b(wb.java:220)
        at com.ibm.db2.jcc.am.gp.uc(gp.java:3564)
        at com.ibm.db2.jcc.am.gp.b(gp.java:4549)
        at com.ibm.db2.jcc.am.gp.oc(gp.java:2867)
        at com.ibm.db2.jcc.am.gp.execute(gp.java:2842)
        at org.flywaydb.core.internal.dbsupport.JdbcTemplate.execute(JdbcTemplate.java:248)
        at org.flywaydb.core.internal.dbsupport.db2.DB2Schema.doClean(DB2Schema.java:81)
        at org.flywaydb.core.internal.dbsupport.Schema.clean(Schema.java:148)
        at org.flywaydb.core.internal.dbsupport.db2.DB2Schema.doDrop(DB2Schema.java:69)
        at org.flywaydb.core.internal.dbsupport.Schema.drop(Schema.java:130)
msallstr added a commit to msallstr/flyway that referenced this issue May 27, 2017
…on tables which is accessed by a MQT

Make an explicit drop of all MQTs if there are tables with versioning
@axelfontaine axelfontaine added this to the Flyway 5.0.0 milestone May 27, 2017
axelfontaine added a commit that referenced this issue Sep 16, 2017
#1649 flyway:clean fails on db2 when trying to drop versioning on tab…
axelfontaine added a commit to flyway/flywaydb.org that referenced this issue Sep 16, 2017
@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Sep 16, 2017

Fixed by @msallstr 's PR. Thanks!

dohrayme pushed a commit to dohrayme/flyway that referenced this issue Feb 3, 2020
…on tables which is accessed by a MQT

Make an explicit drop of all MQTs if there are tables with versioning
dohrayme pushed a commit to dohrayme/flyway that referenced this issue Feb 3, 2020
flyway#1649 flyway:clean fails on db2 when trying to drop versioning on tab…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.