Posted By

jpowell on 05/25/07


Tagged

table textmate rails migration create rake migrate


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

webstic


Rake Migrate Migrations Create Table Example


 / Published in: Rails
 

  1. class AddEntriesTable < ActiveRecord::Migration
  2. def self.up
  3. create_table :entries do |table|
  4. table.column :title, :string
  5. table.column :content, :text
  6. table.column :created_at, :datetime
  7. end
  8. end
  9.  
  10. def self.down
  11. drop_table :entries
  12. end
  13. end

Report this snippet  

You need to login to post a comment.