My first time with Padrino and DataMapper. If I understood correctly,
padrino g model Foo
will makemodels/foo.rb
as well asdb/migrate/001_create_foos.rb
.In order to create an index, I need to specify it in the model, not in the migration.
padrino rake dm:auto:{upgrade|migrate}
will generate the database from models, without paying attention todb/migrate
folder.
So, it seems that migrations are only kept as "just in case" for upgrading production databases. Is there a way to generate a migration from the model? If not, does everyone else also have a headache trying to keep migrations up-to-date as you change your model? How do people write their migrations?
According Padrino documentation i guess you're right. The Orm section states that the auto namespace won't use the generated migrations.
I guess you can track the database with migrations removing the auto namespace as:
And generate migrations as described in the Migration Generator section