eventstore
eventstore copied to clipboard
schema_migrations table name conflicts with ecto table
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
See: https://github.com/elixir-ecto/ecto/blob/master/lib/ecto/migration/schema_migration.ex
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_migrationstable but you can configure the table via:config :app, App.Repo, migration_source: "my_migrations"
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?
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!
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.