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

Couldn't generate migration for custom type due to incorrect path #1

Closed
KungPaoChicken opened this issue Jul 26, 2019 · 5 comments
Closed

Comments

@KungPaoChicken
Copy link

Hello,

First of all thanks for the package!

I have encountered an error when generating the migration using mix money.gen.postgres.migration. This is returned on my machine (Windows 10, Erlang/OTP 22, Elixir 1.8.2 compiled with Erlang/OTP 20):

> mix money.gen.postgres.migration
* creating priv/repo/migrations
** (File.Error) could not read file "c:/my_app/_build/dev/lib/ex_money/priv/SQL/postgres/create_money_with_currency.sql": no such file or directory
    (elixir) lib/file.ex:353: File.read!/1
    lib/mix/tasks/money_postgres_migration.ex:62: Mix.Tasks.Money.Gen.Postgres.Migration.migration_template/1
    lib/mix/tasks/money_postgres_migration.ex:39: anonymous fn/2 in Mix.Tasks.Money.Gen.Postgres.Migration.run/1
    (elixir) lib/enum.ex:769: Enum."-each/2-lists^foreach/1-0-"/2
    (elixir) lib/enum.ex:769: Enum.each/2
    (mix) lib/mix/task.ex:331: Mix.Task.run_task/3
    (mix) lib/mix/cli.ex:79: Mix.CLI.run_task/2
    (elixir) lib/code.ex:767: Code.require_file/2

I believe that the package could not find the file since it looked in ex_money instead of ex_money_sql, possibly following the package split, so I worked around it by copying priv/ from ex_money_sql to ex_money. I am very new to Elixir so I don't know how to fix it in code, but I hope this helps :)

@njwest
Copy link

njwest commented Aug 16, 2019

+1, same problem with mix task looking in ex_money dir:

** (File.Error) could not read file "_build/dev/lib/ex_money/priv/SQL/postgres/create_money_with_currency.sql": no such file or directory

@kipcole9
Copy link
Owner

@KungPaoChicken, @njwest Apologies, I only just saw this issue (I'll check my GitHub notifications). I'll have this fixed in the next 24 hours.

@KungPaoChicken
Copy link
Author

KungPaoChicken commented Aug 19, 2019

No worries, it is a tiny issue which has an easy workaround :)

@kipcole9
Copy link
Owner

I have the fix developed. I'm just implementing a much delayed set of tests for migrations and db operations, should be done in the next 24 hours. Thanks for your patience.

@kipcole9
Copy link
Owner

I have pushed a new release and published version 1.1.0 to hex that I believe resolves this issue, and that of #2.

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

3 participants