Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Suraj Mishra committed Jun 26, 2024
1 parent 77c3add commit b03ab0f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/pg_ha_migrations/safe_statements.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b03ab0f

Please sign in to comment.