kipcole9 / money_sql

Money functions for the serialization of a money data type in Elixir
Other
28 stars 18 forks source link

Could not read file error after upgrading to 1.10.0 #37

Closed bigardone closed 1 year ago

bigardone commented 1 year ago

Hi @kipcole9 👋🏼 After upgrading to 1.10.0, I get the following error while trying to run the migration for min and max:

11:24:35.472 [info] == Running 20231102101154 Marko.Repo.Migrations.AddPostgresMoneyMinmaxFunctions.up/0 forward
** (File.Error) could not read file "priv/SQL/postgres/get_currency_code_type.sql": no such file or directory
    (elixir 1.15.5) lib/file.ex:358: File.read!/1
    (ex_money_sql 1.10.0) lib/money/migration.ex:19: Money.Migration.postgres_money_with_currency_type/1
    (ex_money_sql 1.10.0) lib/money/migration.ex:5: Money.Migration.adjust_for_type/2
    priv/repo/migrations/20231102101154_add_postgres_money_minmax_functions.exs:42: Marko.Repo.Migrations.AddPostgresMoneyMinmaxFunctions.up/0
    (ecto_sql 3.10.2) lib/ecto/migration/runner.ex:289: Ecto.Migration.Runner.perform_operation/3
    (stdlib 5.0.2) timer.erl:270: :timer.tc/2
    (ecto_sql 3.10.2) lib/ecto/migration/runner.ex:25: Ecto.Migration.Runner.run/8
    (ecto_sql 3.10.2) lib/ecto/migrator.ex:366: Ecto.Migrator.attempt/8

I saw a similar closed issue from some years ago. I think the issue is here:

https://github.com/kipcole9/money_sql/blob/493de0770d3ac56cef2423ed7f0ff2e3d019178e/lib/money/migration.ex#L19

Maybe it should be using something like https://github.com/kipcole9/money_sql/blob/493de0770d3ac56cef2423ed7f0ff2e3d019178e/lib/money/ddl.ex#L256 instead.

kipcole9 commented 1 year ago

Thanks for the issue. Yes, thats not good at all! Will fix in the next few hours.

bigardone commented 1 year ago

I can create a PR if you want :)

kipcole9 commented 1 year ago

Always gratefully accepted!Sent from my iPhoneOn 2 Nov 2023, at 18:43, Ricardo García Vega @.***> wrote: I can create a PR if you want :)

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

kipcole9 commented 1 year ago

I've published ex_money_sql version 1.10.1 with the following changelog entry:

Bug Fixes

Thanks again for the support and the PR.