diff --git a/db/migrations/25_make_pv_pacticipants_mandatory.rb b/db/migrations/25_make_pv_pacticipants_mandatory.rb index 913a9f0ca..322240261 100644 --- a/db/migrations/25_make_pv_pacticipants_mandatory.rb +++ b/db/migrations/25_make_pv_pacticipants_mandatory.rb @@ -1,8 +1,16 @@ Sequel.migration do up do + PactBroker::MigrationHelper.with_mysql do + run("SET FOREIGN_KEY_CHECKS = 0") + end + alter_table(:pact_versions) do set_column_not_null(:consumer_id) set_column_not_null(:provider_id) end + + PactBroker::MigrationHelper.with_mysql do + run("SET FOREIGN_KEY_CHECKS = 1") + end end end