Sha256: 338afc485025b4779dede35b871525ce7259dc4cd29796673980118586cbdd54

Contents?: true

Size: 884 Bytes

Versions: 2

Compression:

Stored size: 884 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

2 entries across 2 versions & 1 rubygems

Version Path
tb_cms-1.3.0 spec/dummy/db/migrate/20141231214481_drop_spud_page_liquid_tags.tb_cms.rb
tb_cms-1.3.beta1 spec/dummy/db/migrate/20141231214481_drop_spud_page_liquid_tags.tb_cms.rb