mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Use ALTER INDEX syntax to rename an index
This commit is contained in:
committed by
Aaron Patterson
parent
541ed2b60d
commit
4120e95dce
@@ -849,6 +849,10 @@ module ActiveRecord
|
||||
execute "DROP INDEX #{quote_table_name(index_name)}"
|
||||
end
|
||||
|
||||
def rename_index(table_name, old_name, new_name)
|
||||
execute "ALTER INDEX #{quote_column_name(old_name)} RENAME TO #{quote_table_name(new_name)}"
|
||||
end
|
||||
|
||||
def index_name_length
|
||||
63
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user