Method deprecated or moved
This method is deprecated or moved on the latest stable version.
The last existing version (v4.1.8) is shown here.
rename_column(table_name, column_name, new_column_name)
public
Renames a column in a table.
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb, line 428
def rename_column(table_name, column_name, new_column_name)
clear_cache!
execute "ALTER TABLE #{quote_table_name(table_name)} RENAME COLUMN #{quote_column_name(column_name)} TO #{quote_column_name(new_column_name)}"
rename_column_indexes(table_name, column_name, new_column_name)
end