instance method
rename_index
Ruby on Rails 6.1.7.10
Since v4.2.9Signature
rename_index(table_name, old_name, new_name)
Renames an index of a table. Raises error if length of new index name is greater than allowed limit.
Parameters
-
table_namereq -
old_namereq -
new_namereq
Source
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb, line 477
def rename_index(table_name, old_name, new_name)
validate_index_length!(table_name, new_name)
execute "ALTER INDEX #{quote_column_name(old_name)} RENAME TO #{quote_table_name(new_name)}"
end
Defined in activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb line 477
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaStatements