From 920c3635ae90b446e36479e0568db2773c14ba7b Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Thu, 7 Sep 2017 14:20:25 +1000 Subject: [PATCH] fix: sequel migration 25 for mysql --- db/migrations/25_make_pv_pacticipants_mandatory.rb | 8 ++++++++ 1 file changed, 8 insertions(+) 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