May 18, 2008

Rails2.0 Migration File

The format of Rails2.0 migration file from Rails 1.2.
An example of Rails2.0:

def self.up
create_table :user do |t|
t.string :name, :address
t.timestamps
end
end

"created_at" and "updated_at" are automatically made when "timestamps" is written.

No comments: