Re: Migration Problem

Frederick Cheung
Sun, 13 Apr 2008 15:28:43 -0000

On 13 Apr 2008, at 16:20, Prateek wrote:

>
> Hello,
>
> I am trying to change the default value of a couple of fields in a
> table. In one of my migrations, I had given a default value. It looked
> something like this (Please note - ''users'' table already
exists) -
>
> =================================================>
> So, to remove the default, I just removed the ":default" from
lines
> 4,5,6, and then I ran ''rake db:migrate''. But the default
it still
> there. What should I do to remove it?

You  need to migrate down and then back up again with rake db:migrate
VERSION=x
(rails won''t run migration 2 if migration 2 has already been run, even
if you''ve changed the file since).

Fred