Pregunta

My ruby on rails application does some weird things which i could not understand why.

I am adding a column to a present table through migrations. Here is the mig:

 class AddSomeColumnToSomewhere < ActiveRecord::Migration
  def self.up
   add_column :somehwhere, :mynewcol, :boolean, :default => false
 end

  def self.down
    remove_column :somehwhere, :mynewcol
 end
end

After running this migration i check the db, everything is fine. However, after i run the application, the column disappears.

Why can sth like that happen?

Thanks.

¿Fue útil?

Solución

The app is removing the column knowingly. To ensure, i think, the integrity. Thanks for the answers.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top