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