aboutsummaryrefslogtreecommitdiffstats
path: root/spec/dummy/db/migrate/20101216194133_remove_cached_slug_from_pages.rb
blob: 341bc8f642624bb4bcb4c70d7d61ceb86f045e57 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class RemoveCachedSlugFromPages < ActiveRecord::Migration
  def self.up
    if ::Refinery::Page.column_names.map(&:to_s).include?('cached_slug')
      say_with_time("Removing cached_slug column from ::Refinery::Page table") do
        remove_column ::Refinery::Page.table_name, :cached_slug
      end
    else
      say "Nothing done, no cached_slug field found in ::Refinery::Page table"
    end

    ::Refinery::Page.reset_column_information
  end

  def self.down
    # Don't add this column back, it breaks stuff.
  end
end