require_relative'../../migration_helpers'moduleRuboCopmoduleCopmoduleMigration# Cop that checks if `remove_concurrent_index` is used with `up`/`down` methods# and not `change`.classRemoveConcurrentIndex<RuboCop::Cop::CopincludeMigrationHelpersMSG='`remove_concurrent_index` is not reversible so you must manually define '\'the `up` and `down` methods in your migration class, using `add_concurrent_index` in `down`'.freezedefon_send(node)returnunlessin_migration?(node)returnunlessnode.children[1]==:remove_concurrent_indexnode.each_ancestor(:def)do|def_node|add_offense(def_node,:name)ifmethod_name(def_node)==:changeendenddefmethod_name(node)node.children[0]endendendendend