Migration enum drop check constraints (#1435)

* Fix: apply drop checkConstraints properly which were not applied for Enum to String

* Use IF EXISTS to drop constraints

* added TODO and comment about MariaDB supporting CHECK constraints from version 10.2.1 forward compared to MySQL 5.7/8.0 parsing but ignoring CHECK constraints

* updated reference scripts for dropping constraints on enums
This commit is contained in:
Michael Benz authored and Rob Bygrave committed 2018-06-27 10:38:56 +12:00
1 parent 48b05eb358
commit cf2d9df256
34 files changed
+181 -16

No files matched your search

@@ -61,6 +61,7 @@ public class DbMigrationTest extends BaseTestCase {
"migtest_ckey_detail",
"migtest_ckey_parent",
"migtest_e_basic",
"migtest_e_enum",
"migtest_e_history",
"migtest_e_history2",
"migtest_e_history3",
@@ -41,7 +41,7 @@ public class BaseTableDdlTest {
ddlGen.generate(write, alterColumn);
String ddl = write.apply().getBuffer();
assertThat(ddl).contains("alter table mytab drop constraint ck_mytab_acol");
assertThat(ddl).contains("alter table mytab drop constraint if exists ck_mytab_acol");
assertThat(ddl).contains("alter table mytab add constraint ck_mytab_acol check (acol in ('A','B'))");
}