Created
April 28, 2012 18:09
-
-
Save patrick99e99/2520947 to your computer and use it in GitHub Desktop.
contact migration
This file contains 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
class CreateContacts < ActiveRecord::Migration | |
def self.up | |
create_table :contacts do |t| | |
t.string :first_name | |
t.string :last_name | |
t.timestamps | |
end | |
end | |
def self.down | |
drop_table :contacts | |
end | |
end |
This file contains 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
class CreatePhones < ActiveRecord::Migration | |
def self.up | |
create_table :phones do |t| | |
t.string :number | |
t.references :contact | |
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