If you have already run your original migration (before editing it), then you need to generate a new migration (
If you have not yet run the original migration you can just edit it, like you're trying to do. Your migration code is almost perfect: you just need to remove the
rails generate migration add_email_to_users email:string will do the trick). Then do a rake db:migrate and it'll run the new migration.If you have not yet run the original migration you can just edit it, like you're trying to do. Your migration code is almost perfect: you just need to remove the
add_column
line completely (that code is trying to add a column to a table, before
the table has been created, and your table creation code has already
been updated to include a t.string :email anyway).
No comments:
Post a Comment