Skip to content

Instantly share code, notes, and snippets.

@elvio
Created February 8, 2009 18:52
Show Gist options
  • Save elvio/60452 to your computer and use it in GitHub Desktop.
Save elvio/60452 to your computer and use it in GitHub Desktop.
#
# Migration para criacao de users (model User)
#
class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
t.string :first_name
t.string :last_name
t.string :email
t.timestamps
end
end
def self.down
drop_table :users
end
end
#
# Migration para criacao de phones (model Phone)
#
class CreatePhones < ActiveRecord::Migration
def self.up
create_table :phones do |t|
t.referenfes :user
t.string :ddd
t.string :number
t.timestamps
end
end
def self.down
drop_table :phones
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment