pluginaweek / state_machine

Adds support for creating state machines for attributes on any Ruby class
http://www.pluginaweek.org
MIT License
3.74k stars 507 forks source link

break previous migration #297

Closed ichord closed 9 years ago

ichord commented 10 years ago

My Rails app is migrating to a new date structure, and there are some migrations have to be run together.

First, There is a MyModel.find_by(name: 'NAME').update quantity: 1 execution in previous migration. Then, i add state_machine to this model (MyModel) and set up an initialization: state_machine initial: :active . Then i run all the new migrations, and it raise there is no state column error.

yes, there is no state column while running previous migration. I think it should not touch the state when model is updating others column no matter there is a state or not.

PS. at least, i have to use execute DSL in migration.