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

Error on migration containing references(...) field type #61

Open
Qqwy opened this issue Jun 11, 2018 · 2 comments
Open

Error on migration containing references(...) field type #61

Qqwy opened this issue Jun 11, 2018 · 2 comments

Comments

@Qqwy
Copy link
Contributor

Qqwy commented Jun 11, 2018

The README states:

Type casting. Mnesia can store any data in any field, including strings, numbers, atoms, tuples, floats or even PID's. All types in your migrations will be silently ignored.

I just tried to migrate a Postgres-app over to Ecto_Mnesia, and it was unable to run my migrations because I had references("table_name") fields in there. Since this is also 'just a type', I think better behaviour would be to ignore the result from this as well.

@AndrewDryga
Copy link
Member

@Qqwy I think we should warn instead or ignoring there, so that developer knows what is actually happening. PR is welcome :)

@Qqwy
Copy link
Contributor Author

Qqwy commented Jun 13, 2018

Turns out the reason for this is that Ecto until 2.2 required you to use an atom as table name in references (So references(:table_name) was correct, and references("table_name") would throw). Since 2.2, this was resolved (And running that migration with the new version just skips over it). However, EctoMnesia does not support this new ecto version yet, and the new mix ecto.migrate will not be able to see the database schema created by mix ecto.create for some reason.

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

2 participants