Sha256: 71b471ef49f3354a6e5513879d3ff412f3dccbfa594d40b49d4718ef75c40c83

Contents?: true

Size: 301 Bytes

Versions: 4

Compression:

Stored size: 301 Bytes

Contents

class CreateCategories < ActiveRecord::Migration
  def self.up
    create_table :categories do |t|
      t.string      :name
      t.timestamps
    end
    
    add_column :posts, :category_id, :integer
  end

  def self.down
    remove_column :posts, :category_id
    drop_table :categories
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
heritage-0.3.2 heritage_demo/db/migrate/20110412094758_create_categories.rb
heritage-0.3.1 heritage_demo/db/migrate/20110412094758_create_categories.rb
heritage-0.3.0 heritage_demo/db/migrate/20110412094758_create_categories.rb
heritage-0.2.0 heritage_demo/db/migrate/20110412094758_create_categories.rb