Created
September 6, 2011 15:41
-
-
Save deepakprasanna/1197911 to your computer and use it in GitHub Desktop.
Rails 3.1 Migrations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Before Rails 3.1 | |
class CreateUsers < ActiveRecord::Migration | |
def self.up | |
create_table :users do |t| | |
t.string :name | |
t.string :email | |
t.timestamps | |
end | |
end | |
def self.down | |
drop_table :users | |
end | |
end | |
#In Rails 3.1 | |
class CreateUsers < ActiveRecord::Migration | |
def change | |
create_table :users do |t| | |
t.string :name | |
t.string :email | |
t.timestamps | |
end | |
end | |
end | |
class CreateUsers < ActiveRecord::Migration | |
def up | |
create_table :users do |t| | |
t.string :name | |
t.string :email | |
t.timestamps | |
end | |
end | |
def down | |
drop_table :users | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment