Sha256: 79f38694c1528c0bca47a82cfd4416d0b8b70379633c94183331b3fae9f74115

Contents?: true

Size: 796 Bytes

Versions: 14

Compression:

Stored size: 796 Bytes

Contents

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

14 entries across 14 versions & 1 rubygems

Version Path
tb_cms-1.3.0 db/migrate/20140110142037_drop_spud_page_liquid_tags.rb
tb_cms-1.3.beta1 db/migrate/20140110142037_drop_spud_page_liquid_tags.rb
tb_cms-1.2.3 db/migrate/20140110142037_drop_spud_page_liquid_tags.rb
tb_cms-1.2.2 db/migrate/20140110142037_drop_spud_page_liquid_tags.rb
tb_cms-1.2.1 db/migrate/20140110142037_drop_spud_page_liquid_tags.rb
tb_cms-1.2.0 db/migrate/20140110142037_drop_spud_page_liquid_tags.rb
tb_cms-1.2.0.beta3 db/migrate/20140110142037_drop_spud_page_liquid_tags.rb
tb_cms-1.2.0.beta1 db/migrate/20140110142037_drop_spud_page_liquid_tags.rb
tb_cms-1.1.5 db/migrate/20140110142037_drop_spud_page_liquid_tags.rb
tb_cms-1.1.4 db/migrate/20140110142037_drop_spud_page_liquid_tags.rb
tb_cms-1.1.3 db/migrate/20140110142037_drop_spud_page_liquid_tags.rb
tb_cms-1.1.2 db/migrate/20140110142037_drop_spud_page_liquid_tags.rb
tb_cms-1.1.1 db/migrate/20140110142037_drop_spud_page_liquid_tags.rb
tb_cms-1.1.0 db/migrate/20140110142037_drop_spud_page_liquid_tags.rb