Re: Migrations bug

Hammed Malik
Wed, 21 Sep 2005 14:08:39 -0000

Thanks - I''m on migration 10 right now :)

On 9/20/05, David Naseby <naseby-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
>
> Migrations fail on windows for numbers > 10. To fix this, change
> migrations.rb #migration_files to:
>
> def migration_files
> files = Dir["#{@migrations_path}/[0-9]*_*.rb"].sort_by do |f|
> migration_version_and_name(f).first.to_i
> end
> down? ? files.reverse : files
> end
>
> Previously, it was sorting on a string of the file name, meaning that
> you''d usually start migrating 10_<migration_file>.rb before
getting to
> 1_<migration_file>.rb, resulting in 1-9 never being applied. Nasty.
>
> --
> David Naseby
> http://homepages.ihug.com.au/~naseby/
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>


_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org