Sha256: 66ad5f5b12884c7cc5d8f350f3f5aa2605bc1e4ebb29dd5081af1a3ad6e9b1ba

Contents?: true

Size: 859 Bytes

Versions: 11

Compression:

Stored size: 859 Bytes

Contents

class CreateLiquidCmsUpgradeRev1 < ActiveRecord::Migration
  def self.up
    change_table :cms_assets do |t|
      t.integer :custom_height
      t.integer :custom_width
      t.text :meta_data # serialized yaml
    end

    drop_table :versions

    create_table :cms_tags do |t|
      t.column :name, :string
    end
    
    create_table :cms_taggings do |t|
      t.column :tag_id, :integer
      t.column :taggable_id, :integer
      t.column :taggable_type, :string
      
      t.column :created_at, :datetime
    end
    
    add_index :cms_taggings, :tag_id
    add_index :cms_taggings, [:taggable_id, :taggable_type]
  end

  def self.down
    drop_table :cms_taggings
    drop_table :cms_tags

    create_table :versions do |t|
    end

    change_table :cms_assets do |t|
      t.remove :custom_height, :custom_width, :meta_data
    end
  end
end

Version data entries

11 entries across 5 versions & 1 rubygems

Version Path
liquid_cms-0.3.2.0 lib/generators/liquid_cms/templates/migration_rev1.rb
liquid_cms-0.3.2.0 test/rails_app/db/migrate/20110329201435_create_liquid_cms_upgrade_rev1.rb
liquid_cms-0.2.2.0 test/rails_app/db/migrate/20110329201435_create_liquid_cms_upgrade_rev1.rb
liquid_cms-0.2.2.0 generators/liquid_cms/templates/migration_rev1.rb
liquid_cms-0.2.1.1 generators/liquid_cms/templates/migration_rev1.rb
liquid_cms-0.2.1.1 test/rails_app/db/migrate/20110329201435_create_liquid_cms_upgrade_rev1.rb
liquid_cms-0.3.1.0 test/rails_app/db/migrate/20110329201435_create_liquid_cms_upgrade_rev1.rb
liquid_cms-0.3.1.0 lib/generators/liquid_cms/templates/migration_rev1.rb
liquid_cms-0.3.1.0 generators/liquid_cms/templates/migration_rev1.rb
liquid_cms-0.2.1.0 test/rails_app/db/migrate/20110329201435_create_liquid_cms_upgrade_rev1.rb
liquid_cms-0.2.1.0 generators/liquid_cms/templates/migration_rev1.rb