# User engine migrations foobar on foreign key constraints

**URL:** <https://www.ruby-forum.com/t/user-engine-migrations-foobar-on-foreign-key-constraints/71593>\
**Category:** Engines Development\
**Created:** [October 10, 2006, 6:29am UTC](https://www.ruby-forum.com/t/user-engine-migrations-foobar-on-foreign-key-constraints/71593 "2006-10-10T06:29:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_Estlin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/6f9a4e/32.png) [@Brian\_Estlin](https://www.ruby-forum.com/u/Brian_Estlin)\
**Post date:** [October 10, 2006, 6:29am UTC](https://www.ruby-forum.com/t/user-engine-migrations-foobar-on-foreign-key-constraints/71593/1 "2006-10-10T06:29:34Z")

</div>

hi,

Hope this is the right place and i’m not repeating something on the  
archive (i looked, briefly).

UserEngine gave me some grief when running migrations due to the fact  
that I use foreign key constraints in my database. The order in which  
the tables are created/deleted is important!

I advise creating the permission\_table and role\_table first, then the  
join tables. Drop them in the reverse order.

I can submit a patch if desired.

-Brian

---

<div class="post-metadata">

**Author:** ![Brian\_Estlin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/6f9a4e/32.png) [@Brian\_Estlin](https://www.ruby-forum.com/u/Brian_Estlin)\
**Post date:** [October 10, 2006, 11:02am UTC](https://www.ruby-forum.com/t/user-engine-migrations-foobar-on-foreign-key-constraints/71593/2 "2006-10-10T11:02:08Z")

</div>

A patch for this sounds fine - [http://dev.rails-engines.org](http://dev.rails-engines.org)

Thanks 🙂

James
