Ruby on Rails Thursday, April 27, 2017



On Fri, Apr 28, 2017 at 8:54 AM, Joe Guerra <JGuerra@jginfosys.com> wrote:
Hi, I got stuck on a migration (basically to fix a column name).  I actually went into the table itself and corrected the problem.  My herkou migration gets stuck, and I've got other migrations behind it that aren't running.

If you've already fixed the table manually, then you don't need to run the migration at all.  You have 3 hackish options

1.  Just delete the migration and update the old migration so it uses the correct column name.
2.  Insert the timestamp of the migration that you want to skip to a table called schema_migrations (not sure if this is
the exact name).  Rails basically checks this table to see which migrations need to run.
3.  Edit the migration so that it doesn't do anything, commit, deploy, run db:migrate.  Edit the migration again, commit,
deploy, run db:migrate.  The second db:migrate should not run the edited migration file.

May I ask why you decided to fix the table manually?
 
What should I do?

Thanks,
Joe 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9567374e-3003-4dde-8e3c-cf6c834247e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
-------------------------------------------------------------
visit my blog at http://jimlabs.herokuapp.com

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAJ8y7VcnBcg5PWMxb0y2LtMVqQNuLAgfeOE3L8AKDdoJ4F7LHw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment