Sha256: 36c52c2bb8b1e411ebbe5ba02b0094fb5b06ae39086e9ae1952994ea4f5b891b

Contents?: true

Size: 676 Bytes

Versions: 11

Compression:

Stored size: 676 Bytes

Contents

class AddInMenuToSection < ActiveRecord::Migration
  def self.up
    unless columns(:website_sections).collect {|c| c.name}.include?('in_menu')
      add_column :website_sections, :in_menu, :boolean
    end
    unless columns(:website_section_versions).collect {|c| c.name}.include?('in_menu')
      add_column :website_section_versions, :in_menu, :boolean
    end
  end

  def self.down
    if columns(:website_sections).collect {|c| c.name}.include?('in_menu')
      remove_column :website_sections, :in_menu
    end
    if columns(:website_section_versions).collect {|c| c.name}.include?('in_menu')
      remove_column :website_section_versions, :in_menu
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
knitkit-2.0.11 db/migrate/upgrade/20111027145006_add_in_menu_to_section.rb
knitkit-2.0.10 db/migrate/upgrade/20111027145006_add_in_menu_to_section.rb
knitkit-2.0.9 db/migrate/upgrade/20111027145006_add_in_menu_to_section.rb
knitkit-2.0.7 db/migrate/upgrade/20111027145006_add_in_menu_to_section.rb
knitkit-2.0.6 db/migrate/upgrade/20111027145006_add_in_menu_to_section.rb
knitkit-2.0.5 db/migrate/upgrade/20111027145006_add_in_menu_to_section.rb
knitkit-2.0.4 db/migrate/upgrade/20111027145006_add_in_menu_to_section.rb
knitkit-2.0.3 db/migrate/upgrade/20111027145006_add_in_menu_to_section.rb
knitkit-2.0.2 db/migrate/upgrade/20111027145006_add_in_menu_to_section.rb
knitkit-2.0.1 db/migrate/upgrade/20111027145006_add_in_menu_to_section.rb
knitkit-2.0.0 db/migrate/upgrade/20111027145006_add_in_menu_to_section.rb