Coexisting with a Rails database

Ecto.Migrator.up accepts a prefix option with which you can specify a schema. The schema_migrations table will be created in that schema. From the CLI: mix ecto.migrate --prefix prefix_name.

In the past 2 years I’ve been working on a Phoenix app that needed to live alongside a legacy application and share its database. In order to improve separation I decided to put my app’s “private” tables in a separate schema, with their own migrations.

I don’t recall what it was like with Rails, but with Ecto I had no issues or roadblocks with the multi-schema setup :slight_smile: