Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialBinu Alexander
4,081 PointsHow to add 2 fields into migration from command line ?
How to add 2 columns in a single migration ?
rails generate migration AddDetailsToContacts first_name:string, last_name:string
2 Answers
Maciej Czuchnowski
36,441 PointsRemoving the comma should do the trick.
Binu Alexander
4,081 Pointsrails generate migration contacts first_name:string last_name:string
this is working
Binu Alexander
4,081 PointsBinu Alexander
4,081 PointsThis is my code :rails generate migration AddDetailsToContacts first_name :string last_name :string
This is the error : The first argument should be the name of the table.
I removed the comma , still the error
jordans
1,609 Pointsjordans
1,609 PointsTry putting in:
rails generate migration contacts first_name:string last_name:string
Maciej Czuchnowski
36,441 PointsMaciej Czuchnowski
36,441 PointsWeird, it should assume contacts table by default from the name of the migration. Try:
rails generate migration add_details_to_contacts first_name:string last_name:string