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 trial

Ruby Build a Simple Ruby on Rails Application Creating an Authentication System Migrating Statuses

Michael Wei
Michael Wei
647 Points

Why create a new migrate file instead of modifying the original CreateStatuses migrate file?

For adding the user_id column and removing the name column, why not modify the create_statuses file instead of creating a new add_user_id_to_statuses file?

Is it because create_statuses won't actually run anymore, because we've already created the statuses table, and may want to keep the data that's in it instead of deleting it and starting from scratch?

Bruno Bandeira de Azevedo
Bruno Bandeira de Azevedo
25,374 Points

It's always good to build your migration files in increments, so that if you need to do a Rollback you can do so in small steps. But you could do that if you wanted to, sure =P

1 Answer

Michael Wei
Michael Wei
647 Points

Ah, I understand. Great answer, thanks Bruno!