Forum: Ruby on Rails Use Migrations in modules in separate source trees?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Marcus A. (Guest)
on 2006-03-16 12:17
(Received via mailing list)
We have a scenario where we have a core engine with module add-ons. What
modules that will be used differ from deployment to deployment. Each of
these modules might need different things in the db (both structure and
data) and I want each module to be in charge of its own db structure.
Each module is contained in its own source directory and what modules to
use is determined in the build process (each module has it's own build
script (with some inherited from a "main" build script) and I want db
scripts to be executed in this process).

I really like Migrations and would like to use it. Is it possible to use
in a scenario like this? What do I need to do in order to make it work
(if possible)? Keep in mind that all modifications from all modules goes
into the same database and that the order of how the module build
scripts are executed might vary from deployment to deployment so the
numbering scheme and schema_info table might be troublesome in this
case. I guess I need to be able to get a module name/code into it
somewhere somehow.

Any answers/ideas appreciated!

James A. (Guest)
on 2006-03-16 12:51
(Received via mailing list)
You should look at the migrations stuff in Rails Engines - you might
find you can use this straight out of the box. If you treat each one
of your 'modules' as an engine, you'll have access to the migrations
in each module and the ability to migrate individual modules up and
down as necessary. (section 'Migrating Engines')

- james

On 3/16/06, Marcus A. <removed_email_address@domain.invalid> wrote:
> in a scenario like this? What do I need to do in order to make it work
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid

* J *
This topic is locked and can not be replied to.