@@ -0,0 +1,972 @@
+package db.h2.migration;%0A%0Aimport java.sql.Connection;%0Aimport java.sql.ResultSet;%0Aimport org.flywaydb.core.api.migration.jdbc.JdbcMigration;%0A%0Apublic class V3__remove_foreign_key implements JdbcMigration %7B%0A  public void migrate(Connection connection) throws Exception %7B%0A    String find = %22select CONSTRAINT_TYPE, CONSTRAINT_NAME, TABLE_NAME from information_schema.constraints%22;%0A    ResultSet constraints = connection.createStatement().executeQuery(find);%0A    while  (constraints.next()) %7B%0A      String type = constraints.getString(%22CONSTRAINT_TYPE%22);%0A      String constraint = constraints.getString(%22CONSTRAINT_NAME%22);%0A      String table = constraints.getString(%22TABLE_NAME%22);%0A      if(type == %22REFERENTIAL%22) %7B%0A        connection.createStatement().executeUpdate(%22ALTER TABLE %22 + table + %22 DROP CONSTRAINT %22 + constraint);%0A        System.out.printf(%22Found constraint (%25s, %25s, %25s)%22, type, constraint, table);%0A        System.out.println(%22 - Dropped it.%22);%0A      %7D%0A    %7D%0A  %7D%0A%7D%0A

Remove constraints from H2.