Ruby-on-rails – Migrations in Rails Engine

rails-enginesruby-on-railsruby-on-rails-3

I have multiple rails applications talking to the same backend and I'd like them to share some migrations.
I setup a rails engine (with enginex), I can share anything (controllers, views, models,…) but no migrations. I can't make it work !

I tried to create a file db/migrate/my_migration.rb but in my main application if I do :

  rake db:migrate

It doesn't load them.

After some googling it appears there was some recent work on this and it seems this has been merge to rails master.
I'm with rails 3.0.3 do you see any way to make this work ?

Thanks !

Best Answer

In rails 3.1, you can do it using this command, give that your engine name is example:

# Note that you append _engine to the name
rake example_engine:install:migrations