Skip to content

Instantly share code, notes, and snippets.

@deepakprasanna
Created September 6, 2011 15:42
Show Gist options
  • Save deepakprasanna/1197914 to your computer and use it in GitHub Desktop.
Save deepakprasanna/1197914 to your computer and use it in GitHub Desktop.
Rails 3.1 Migrations
####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