Question about how engine plugin handles migrations

Hi all,

I have a question about how engines deals with migrations (really, I
could test this myself, but since I haven’t used engines I was
wondering if someone might have a definitive or ‘official’ answer).

  1. Let’s say I have a core application (we’ll call it core_wiki for
    kicks) - and it has some views, models, controllers and migrations
    that I turn into an engine / plugin… so I move my migrations (let’s
    say 001, 002 and 003) into the appropriate
    vendor/plugins/core_wiki/db/migrate directory - and I’m off to the
    races.

  2. Now I run script/generate plugin_migration && rake db:migrate - and
    I get my migrations copied over to my ‘real’ application (e.g. into
    my_custom_wiki/db/migrate).

  3. Let’s say I now customize the my_custom_wiki APPLICATION (not the
    engine functionality - but the actual application) - and I end up
    adding a few migrations into the actual application (hypothetically
    004, 005 and 006).

  4. Now I come to a point where I want to add a few more features to
    the core_wiki (which would be the vendor/plugins/core_wiki part).
    These features requires some new migrations, which if I name in
    sequence would also be migrations with names 004, 005 and 006 - since
    the my_custom_wiki migrations (mentioned in step 3) were part of the
    my_custom_wiki application, and not the core_wiki plugin. What now
    happens when I run script/generate plugin_migration && rake db:migrate
    again? Are the new core_wiki migrations copied over to my actual
    applications db/migrate directory as 007, 008, 009? Is that all that
    happens? Or is this not the type of situation that the Engine plugin
    is supposed to be used for at all?

Basically the situation I have is that I have a core piece of software
that will be deployed to multiple clients.

Each client will require customizations of the software, which may
involve custom database migrations.

At the same time, I want to continue to build/develop/add features to
the core, and have the ability to easily deploy these new features,
bug fixes, etc. to each client (Yes - I know that a lot of care must
be taken when doing this - mostly I just want to know how the Engine
plugin will deal with the migration scenario I’ve described above).

If none of that makes sense, please forgive me and ask me to clarify -
it’s still before 10am and I need some more coffee.

-daniel