Sha256: 3f7af0ce147dbd4f8aaaf158a86c800e92894de82f169a82fde2d2098075f1d3

Contents?: true

Size: 859 Bytes

Versions: 5

Compression:

Stored size: 859 Bytes

Contents

# This migration comes from tb_cms (originally 20140110142037)
class DropSpudPageLiquidTags < ActiveRecord::Migration

  class SpudPageLiquidTag < ActiveRecord::Base
  end

  def up
    if defined?(SpudLiquidTag)
      SpudPageLiquidTag.all.each do |tag|
        SpudLiquidTag.create({
          :attachment_id => tag.attachment_id,
          :attachment_type => tag.attachment_type,
          :tag_name => tag.tag_name,
          :value => tag.value
        })
      end
    end
    drop_table :spud_page_liquid_tags
  end

  def down
    create_table :spud_page_liquid_tags do |t|
      t.integer :attachment_id
      t.string :attachment_type
      t.string :tag_name
      t.string :value
      t.timestamps
    end
    add_index :spud_page_liquid_tags, [:tag_name,:value]
    add_index :spud_page_liquid_tags, [:attachment_type,:attachment_id]
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tb_cms-1.2.3 spec/dummy/db/migrate/20141231214481_drop_spud_page_liquid_tags.tb_cms.rb
tb_cms-1.2.2 spec/dummy/db/migrate/20141231214481_drop_spud_page_liquid_tags.tb_cms.rb
tb_cms-1.2.1 spec/dummy/db/migrate/20141231214481_drop_spud_page_liquid_tags.tb_cms.rb
tb_cms-1.2.0 spec/dummy/db/migrate/20141231214481_drop_spud_page_liquid_tags.tb_cms.rb
tb_cms-1.2.0.beta3 spec/dummy/db/migrate/20141231214481_drop_spud_page_liquid_tags.tb_cms.rb