Class: ChangeTermColumnType
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- ChangeTermColumnType
- Defined in:
- lib/generators/persistence/templates/db/migrate/004_change_term_column_type.rb
Class Method Summary collapse
Class Method Details
.down ⇒ Object
8 9 10 11 12 |
# File 'lib/generators/persistence/templates/db/migrate/004_change_term_column_type.rb', line 8 def self.down remove_index :terms, :name => "label_value_calc_id_index" change_column :terms, :value, :string add_index "terms", ["label", "value", "calculation_id"], :name => "label_name_calc_id_index" end |
.up ⇒ Object
2 3 4 5 6 |
# File 'lib/generators/persistence/templates/db/migrate/004_change_term_column_type.rb', line 2 def self.up remove_index :terms, :name => "label_name_calc_id_index" change_column :terms, :value, :text add_index :terms, [:label, :value, :calculation_id], :name => "label_value_calc_id_index", :length => { :value => 20 } end |