From 0ee48e10099b67df5ad7ef25b1c2229f042f7c74 Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Thu, 7 Sep 2017 14:15:23 +1000 Subject: [PATCH] fix: sequel migration 19 for mysql Closes: https://github.com/pact-foundation/pact_broker/issues/33 --- .../19_make_pact_version_content_sha_not_nullable.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/db/migrations/19_make_pact_version_content_sha_not_nullable.rb b/db/migrations/19_make_pact_version_content_sha_not_nullable.rb index 08b7962fc..bf3e63d59 100644 --- a/db/migrations/19_make_pact_version_content_sha_not_nullable.rb +++ b/db/migrations/19_make_pact_version_content_sha_not_nullable.rb @@ -2,9 +2,17 @@ require_relative 'migration_helper' Sequel.migration do - change do + up do + PactBroker::MigrationHelper.with_mysql do + run("SET FOREIGN_KEY_CHECKS = 0") + end + alter_table(:pacts) do set_column_not_null(:pact_version_content_sha) end + + PactBroker::MigrationHelper.with_mysql do + run("SET FOREIGN_KEY_CHECKS = 1") + end end end