PasteBin on this domain is being retired. Please use PasteBin on paste.adora.dk instead.

Pastebin

Paste #1057: RoR ActiveRecord neatness

< previous paste - next paste>

Pasted by Simon

Download View as text

simon@diogenes:~/forum$ cat db/migrate/001_create_posts.rb
class CreatePosts < ActiveRecord::Migration
  def self.up
    create_table :posts do |t|
      t.column :parent_id, :integer
      t.column :ancestor_id, :integer

      t.column :author, :string
      t.column :subject, :string
      t.column :body, :text

      t.column :created, :datetime
      t.column :modified, :datetime
      t.column :hidden, :boolean
    end
  end

  def self.down
    drop_table :posts
  end
end

Paste below


Do not write anything in this field if you're a human.

Go to most recent paste.