# Question about how engine plugin handles migrations

**URL:** <https://www.ruby-forum.com/t/question-about-how-engine-plugin-handles-migrations/119400>\
**Category:** Engines\
**Created:** [November 6, 2007, 6:59pm UTC](https://www.ruby-forum.com/t/question-about-how-engine-plugin-handles-migrations/119400 "2007-11-06T18:59:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Wintschel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c2a13f/32.png) [@Daniel\_Wintschel](https://www.ruby-forum.com/u/Daniel_Wintschel)\
**Post date:** [November 6, 2007, 6:59pm UTC](https://www.ruby-forum.com/t/question-about-how-engine-plugin-handles-migrations/119400/1 "2007-11-06T18:59:01Z")

</div>

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
