Created
February 16, 2016 01:12
-
-
Save armandofox/232339c79f85b2656e3b to your computer and use it in GitHub Desktop.
associations_migration.rb
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
# Run 'rails generate migration create_reviews' and then | |
# edit db/migrate/*_create_reviews.rb to look like this: | |
class CreateReviews < ActiveRecord::Migration | |
def up | |
create_table 'reviews' do |t| | |
t.integer 'potatoes' | |
t.text 'comments' | |
t.references 'moviegoer' | |
t.references 'movie' | |
end | |
end | |
def down ; drop_table 'reviews' ; end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment