For those who are using postgresql db and facing error
StandardError: An error has occurred, this and all later migrations canceled:
=== Dangerous operation detected #strong_migrations ===
Adding an index non-concurrently blocks writes
please refer this article
example:
class AddAncestryToWasteCodes < ActiveRecord::Migration[6.0]
disable_ddl_transaction!
def change
add_column :waste_codes, :ancestry, :string
add_index :waste_codes, :ancestry, algorithm: :concurrently
end
end