diff --git a/lib/pg_ha_migrations/safe_statements.rb b/lib/pg_ha_migrations/safe_statements.rb index 0a6ef04..a8283f4 100644 --- a/lib/pg_ha_migrations/safe_statements.rb +++ b/lib/pg_ha_migrations/safe_statements.rb @@ -598,6 +598,12 @@ def safely_acquire_lock_for_table(table, mode: :access_exclusive, &block) Thread.current[__method__] = nil unless nested_target_table end + # since rails version 6.0+ & 7.0 has bug which does not handle symbol for + # constraint name, we are converting name to string explicitly to solve that. + def unsafe_remove_check_constraint(table, name:, **options) + super(table, name: name.to_s, **options) + end + def adjust_lock_timeout(timeout_seconds = PgHaMigrations::LOCK_TIMEOUT_SECONDS, &block) _check_postgres_adapter! original_timeout = ActiveRecord::Base.value_from_sql("SHOW lock_timeout").sub(/s\Z/, '').to_i * 1000