Created
February 8, 2009 18:52
-
-
Save elvio/60452 to your computer and use it in GitHub Desktop.
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
# | |
# 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