# Generating Migrations

**URL:** <https://www.ruby-forum.com/t/generating-migrations/54170>\
**Category:** Engines Development\
**Created:** [February 25, 2006, 4:11am UTC](https://www.ruby-forum.com/t/generating-migrations/54170 "2006-02-25T04:11:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![subimage](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@subimage](https://www.ruby-forum.com/u/subimage)\
**Post date:** [February 25, 2006, 4:11am UTC](https://www.ruby-forum.com/t/generating-migrations/54170/1 "2006-02-25T04:11:07Z")

</div>

How are you all going about generating migrations for your engines?

Right now I’m just calling script/generate migration then moving it into  
the /vendor/plugins/my\_engine/db/migrations path.

Is this the “right way” to be doing it?

---

<div class="post-metadata">

**Author:** ![subimage](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@subimage](https://www.ruby-forum.com/u/subimage)\
**Post date:** [February 28, 2006, 7:45am UTC](https://www.ruby-forum.com/t/generating-migrations/54170/2 "2006-02-28T07:45:50Z")

</div>

Subimage wrote:

> How are you all going about generating migrations for your engines?
> 
> Right now I’m just calling script/generate migration then moving it into  
> the /vendor/plugins/my\_engine/db/migrations path.
> 
> Is this the “right way” to be doing it?

Also to followup - when I do rake engine\_migrate sometimes it works -  
sometimes it doesn’t. Additionally the schema\_info table doesn’t change  
at all.

Can anyone shed some light as to how exactly this works?

---

<div class="post-metadata">

**Author:** ![subimage](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@subimage](https://www.ruby-forum.com/u/subimage)\
**Post date:** [February 28, 2006, 10:39am UTC](https://www.ruby-forum.com/t/generating-migrations/54170/3 "2006-02-28T10:39:58Z")

</div>

I tend to write my migrations by hand, but there’s no reason why you  
can’t generate them using ‘script/generate migration’ and then move  
the corresponding file (renaming it to ensure it has the correct  
number) into your engine.

The schema\_info table isn’t involved in engine migration at all, since  
we need to track multiple engines. The table which does this is,  
accordingly, engine\_schema\_info.

I’m not sure why the engine\_migrate task might fail. Is it with a  
particular engine? I know in the past the user engine had some  
problems - you might want to make sure you have the latest version…

- james

On 2/28/06, Subimage [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> at all.
> 
> Can anyone shed some light as to how exactly this works?
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> * * *
> 
> engine-developers mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rails-engines.org/listinfo.cgi/engine-developers-rails-engines.org](http://lists.rails-engines.org/listinfo.cgi/engine-developers-rails-engines.org)

–

- J \*  
~
