Separating Migrations and Version Table in Engine for Isolation: Has Anyone Tried This Method?

This message was imported from the Ruby/Rails Modularity Slack server. Find more info in the import thread.

Message originally sent by slack user U783ITZM13O

Hi all! Weird question. Did anyone experiment with keeping migrations and the migrations version table separate in their engine so not to be affected by the main apps version? Some of our engines are support engines and don’t need anything related to our main app, almost be considered completely separate. So to sorta of truly isolate them?

We have some engines that connect to a separate database (and I expect us to see more of that given that it’s easier on Rails 6). I have yet to check how migrations are handled there though.

Message originally sent by slack user U78EKGG059M

We have not done this yet. We do intend as a next step to isolate DBs/tables to our larger components with an eye to eventually deploying them separately. Or at least having that option fairly easily if/when we decide a team could move quicker as a deployable. Currently DBs/migrations are all together still.

Message originally sent by slack user U783ITZM13O

Perfect. Feel less crazy now :slightly_smiling_face:

Message originally sent by slack user U78EKGG059M

I know right! Thanks for putting this slack together. Its amazing to see the similar troubles and solutions we are all coming up with. Really helps validate our thinking.

Message originally sent by slack user U78ED6ZP89S

We register those engines as separate applications in our migration tool based on gh-ost, hence those migrations are tracked separately in their respective DB

We have some engines that connect to a separate database (and I expect us to see more of that given that it’s easier on Rails 6). I have yet to check how migrations are handled there though.

Message originally sent by slack user U78ED6ZP89S

For engines that share the same DB with the main app, we ask engineers to “install” their migrations at the main app level when it is ready to share/deploy.

Message originally sent by slack user U78ED6ZP89S

For clarification, @stephan and I both work at Gusto :slightly_smiling_face: