Sha256: 41df9b1d57a16392dd7058f4a17a5d27ab8d482f94c98e093b98c2f8f7123f0c

Contents?: true

Size: 796 Bytes

Versions: 17

Compression:

Stored size: 796 Bytes

Contents

class AddIndexes < ActiveRecord::Migration
  def self.up
    add_index :pages,       :class_name,            :name => :pages_class_name
    add_index :pages,       :parent_id,             :name => :pages_parent_id
    add_index :pages,       %w{slug parent_id},     :name => :pages_child_slug
    add_index :pages,       %w{virtual status_id},  :name => :pages_published
    
    add_index :page_parts,  %w{page_id name},       :name => :parts_by_page
  end

  def self.down
    remove_index :page_parts, :name => :parts_by_page
                              
    remove_index :pages,      :name => :pages_published
    remove_index :pages,      :name => :pages_child_slug
    remove_index :pages,      :name => :pages_parent_id
    remove_index :pages,      :name => :pages_class_name
  end
end

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
radiantcms-couchrest_model-0.2.4 db/migrate/20081203140407_add_indexes.rb
radiantcms-couchrest_model-0.2.2 db/migrate/20081203140407_add_indexes.rb
radiantcms-couchrest_model-0.2.1 db/migrate/20081203140407_add_indexes.rb
radiantcms-couchrest_model-0.2 db/migrate/20081203140407_add_indexes.rb
radiantcms-couchrest_model-0.1.9 db/migrate/20081203140407_add_indexes.rb
radiantcms-couchrest_model-0.1.8 db/migrate/20081203140407_add_indexes.rb
radiantcms-couchrest_model-0.1.7 db/migrate/20081203140407_add_indexes.rb
radiantcms-couchrest_model-0.1.6 db/migrate/20081203140407_add_indexes.rb
radiantcms-couchrest_model-0.1.5 db/migrate/20081203140407_add_indexes.rb
radiant-0.7.2 db/migrate/20081203140407_add_indexes.rb
radiant-0.8.2 db/migrate/20081203140407_add_indexes.rb
radiant-0.9.0.rc2 db/migrate/20081203140407_add_indexes.rb
radiant-rc-0.9.0 db/migrate/20081203140407_add_indexes.rb
radiant-0.8.1 db/migrate/20081203140407_add_indexes.rb
radiant-0.7.0 db/migrate/20081203140407_add_indexes.rb
radiant-0.8.0 db/migrate/20081203140407_add_indexes.rb
radiant-0.7.1 db/migrate/20081203140407_add_indexes.rb