method
copy_table_indexes
v1.2.0 -
Show latest stable
-
0 notes -
Class: ActiveRecord::ConnectionAdapters::FirebirdAdapter
- 1.0.0
- 1.1.0
- 1.1.1
- 1.1.6
- 1.2.0 (0)
- 1.2.6 (0)
- 2.0.0
- 2.0.1
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.2
- 2.3.8
- 3.0.0
- 3.0.5
- 3.0.7
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.3
- 3.2.8
- 3.2.13
- What's this?
copy_table_indexes(from, to)
private
Hide source
# File activerecord/lib/active_record/connection_adapters/firebird_adapter.rb, line 656 def copy_table_indexes(from, to) indexes(from).each do |index| unless index.name[from.to_s] raise ActiveRecordError, "Cannot rename index #{index.name}, because the index name does not include " << "the original table name (#{from}). Try explicitly removing the index on the " << "original table and re-adding it on the new (renamed) table." end options = {} options[:name] = index.name.gsub(from.to_s, to.to_s) options[:unique] = index.unique add_index(to, index.columns, options) end end


