Sha256: 5d5d4301b8b38a4c743474df59fe2ffd3f098d2ffad9dd6f5fbfc15ed8247348

Contents?: true

Size: 462 Bytes

Versions: 4

Compression:

Stored size: 462 Bytes

Contents

class CreateArticles < ActiveRecord::Migration
  def self.up
    create_table :articles do |t|
      t.string :title
      t.string :title_slug
      t.text :body
      t.text :body_html
      t.integer :user_id
      
      t.timestamps
    end
    
    add_index :articles, :title_slug
    add_index :articles, :user_id
  end

  def self.down
    remove_index :articles, :title_slug
    remove_index :articles, :user_id
    
    drop_table :articles
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hubbub-0.0.11 lib/db/migrate/20091226230412_create_articles.rb
hubbub-0.0.10 lib/db/migrate/20091226230412_create_articles.rb
hubbub-0.0.9 lib/db/migrate/20091226230412_create_articles.rb
hubbub-0.0.8 lib/db/migrate/20091226230412_create_articles.rb