Sha256: e2a7c8ac8be2f8ee44ffa7554af92927fcec0c37c80ea84e11695091706365ac

Contents?: true

Size: 493 Bytes

Versions: 6

Compression:

Stored size: 493 Bytes

Contents

class AddIndexOnCategories < ActiveRecord::Migration
  def self.up
    add_index :categories_elements, [:category_id, :element_id], :unique => true
    change_column :categories, :type, :string, :limit => 45 
    add_index :categories, [:id, :type], :unique => true
  end

  def self.down
    remove_index :categories_elements, :column => [:category_id, :element_id]
    remove_index :categories, :column => [:id, :type]
    change_column :categories, :type, :string, :limit => 255 
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
forgeos_core-1.9.5.rc2 db/migrate/20100413133941_add_index_on_categories.rb
forgeos_core-1.9.5.rc1 db/migrate/20100413133941_add_index_on_categories.rb
forgeos_core-1.9.4 db/migrate/20100413133941_add_index_on_categories.rb
forgeos_core-1.9.3 db/migrate/20100413133941_add_index_on_categories.rb
forgeos_core-1.9.2 db/migrate/20100413133941_add_index_on_categories.rb
forgeos_core-1.9.1 db/migrate/20100413133941_add_index_on_categories.rb