eventstore icon indicating copy to clipboard operation
eventstore copied to clipboard

schema_migrations table name conflicts with ecto table

Open davich opened this issue 8 years ago • 5 comments

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 avatar Oct 12 '17 22:10 davich

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

davich avatar Oct 12 '17 22:10 davich

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"

slashdotdash avatar Oct 13 '17 08:10 slashdotdash

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?

dkushner avatar Jul 06 '18 01:07 dkushner

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!

mustela avatar Dec 05 '19 11:12 mustela

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.

namxam avatar Feb 19 '20 08:02 namxam