I wasn't aware of reversible.
In this case it doesn't seem to matter, as both up and down migrations work.
Nevertheless, I'm fixed it. Thanks

Hugo Peixoto
--

http://hugopeixoto.net


On Sun, Feb 23, 2014 at 6:57 AM, Kuldeep Aggarwal
<notifications@github.com>wrote:

> In db/migrate/20140223061035_add_project_host.rb:
>
> > @@ -0,0 +1,11 @@
> > +class AddProjectHost < ActiveRecord::Migration
> > +  class Project < ActiveRecord::Base
> > +  end
> > +
> > +  def change
> > +    add_column :projects, :host, :string, default: 'github'
> > +
> > +    # Update all existing projects
> > +    Project.where(host: nil).update_all(host: 'github')
>
> This should be in reversible.up section.
>
> reversible do |dir|
>   dir.up  { Project.where(host: nil).update_all(host: 'github') }end
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/tip4commit/tip4commit/pull/53/files#r9974620>
> .
>