Sha256: b982cd19872b975135c006cdffbfbda73d4da3d62495793fce7fb973d368fbae

Contents?: true

Size: 418 Bytes

Versions: 6

Compression:

Stored size: 418 Bytes

Contents

class AddCounterForThemesPages < ActiveRecord::Migration
  def up
    add_column "#{Landable.configuration.database_schema_prefix}landable.themes", :pages_count, :integer, default: 0, null: false

    Landable::Theme.all.each do |t|
      Landable::Theme.reset_counters(t.id, :pages)
    end
  end

  def down
    remove_column "#{Landable.configuration.database_schema_prefix}landable.themes", :pages_count
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
landable-1.14.0 db/migrate/20141217171816_add_counter_for_themes_pages.rb
landable-1.13.2 db/migrate/20141217171816_add_counter_for_themes_pages.rb
landable-1.13.1 db/migrate/20141217171816_add_counter_for_themes_pages.rb
landable-1.12.3 db/migrate/20141217171816_add_counter_for_themes_pages.rb
landable-1.12.2 db/migrate/20141217171816_add_counter_for_themes_pages.rb
landable-1.12.1 db/migrate/20141217171816_add_counter_for_themes_pages.rb