method
copy_table_indexes

v1.2.6 -
Show latest stable
-
0 notes -
Class: ActiveRecord::ConnectionAdapters::FirebirdAdapter
- 1.0.0
- 1.1.6
- 1.2.6 (0)
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7
- 5.2.3
- 6.0.0
- 6.1.3.1
- 6.1.7.7
- 7.0.0
- 7.1.3.2
- 7.1.3.4
- 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