Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

schema_migrations table name conflicts with ecto table #73

Open
davich opened this issue Oct 12, 2017 · 5 comments
Open

schema_migrations table name conflicts with ecto table #73

davich opened this issue Oct 12, 2017 · 5 comments

Comments

@davich
Copy link

davich commented Oct 12, 2017

The schema_migrations table name introduced in v0.10.0 conflicts with the ecto table schema_migrations, yet it has different columns.

This means you are unable to use the same database for eventstore and your phoenix app.

Is there some way we could change the table name to not conflict, or make it configurable?

Thanks

@davich
Copy link
Author

davich commented Oct 12, 2017

See: https://github.com/elixir-ecto/ecto/blob/master/lib/ecto/migration/schema_migration.ex

@slashdotdash
Copy link
Member

slashdotdash commented Oct 13, 2017

Yes, it's worth making the table name configurable to allow the same database to be used for both events and read model projections.

As a temporary workaround Ecto allows you to rename its migration table in config.

Version numbers of migrations will be saved in schema_migrations table but you can configure the table via:

config :app, App.Repo, migration_source: "my_migrations"

@dkushner
Copy link

dkushner commented Jul 6, 2018

Seems like this is already on the radar, and the workaround provided is fairly reasonable, but since I'm here about 8 months down the line, figured I'd mention I've also run into this issue. May be worth mentioning in the documentation somewhere?

@mustela
Copy link

mustela commented Dec 5, 2019

Yes, adding it to the documentation would be awesome. I ran into this issue this morning, and it took me some time to realise that there was a conflict with ecto. Thanks!

@namxam
Copy link

namxam commented Feb 19, 2020

As it has not been mentioned yet, but there is a recent commit 6b2bbfe which introduces support for ecto schemas. It is also fairly documented in master. So it is an easy way to prevent before mentioned issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants