Skip to content

Releases: ex-money/money_sql

Money SQL version 2.0.0

23 Apr 17:34

Choose a tag to compare

Breaking changes

  • The public API has not changed - just the dependency matrix. There should be no upgrade issues for current users beyond the changes in ex_money 6.0.

  • Supported on Elixir 1.17 or later only.

  • Requires ex_money ~> 6.0, which replaces the ex_cldr family of dependencies with the unified localize package. As a result, the CLDR backend module (e.g. MyApp.Cldr) and the :default_cldr_backend configuration key are no longer used. Configure locales via config :localize instead. See the ex_money 6.0 migration guide for details.

  • The error message format for Money.UnknownCurrencyError now follows the ex_money 6.0 convention (for example "The currency :AAA is not known."). Tests asserting on the previous message text will need to be updated.

  • jason is no longer a declared dependency. Postgrex defaults to Jason for json/jsonb columns; configure config :postgrex, :json_library, JSON (Elixir 1.18+) and run mix deps.compile postgrex --force once since Postgrex captures this setting at compile time.

Money SQL version 1.12.0

15 Jan 22:48

Choose a tag to compare

Enhancements

  • Adds avg SQL function for both Postgres and MySQL. Thanks very much to @peaceful-james for the PR. Closes #44.

Money SQL version 1.11.1

07 Nov 21:32

Choose a tag to compare

Bug Fixes

  • Allow casting of (very old) type values from the database for Money.Ecto.Map.Type. Thanks to @peaceful-james for the PR. Closes #43.

Money SQL version 1.11.0

24 Jan 00:31

Choose a tag to compare

Enhancements

  • When dumping a Money.Ecto.Composite.Type, detect if dump/3 is being called by Ecto.Type.embedded_dump/2. If it is, then return a map that can be serialized to JSON. If it isn't (most cases) then return the tuple to be serialized to Postgres. See papertrail issue.

Money SQL version 1.10.1

02 Nov 21:55

Choose a tag to compare

Bug Fixes

  • Fix compilation warnings on Elixir 1.16.

  • Fix migration generator for money_with_currency type. Thanks to @bigardone for the issue and PR. Closes #37, closes #38.

Money SQL version 1.10.0

30 Oct 04:12

Choose a tag to compare

Bug Fixes

  • The mix tasks that generate database function migrations (money.gen.postgres.sum_function, money.gen.postgres.plus_operator and money.gen.postgres.min_max_functions) need to be aware of the type of the money_with_currency "amount" element in a Postgres database. In releases of ex_money_sql up to 1.7.1 the type was char(3). In later releases is changed to the more canonical varchar. In turn, the database functions need to know the type for the internal accumulator. It is possible, as illustrated in issue #36, to have generated the money_with_currency type as char(3) and then move to a later release of ex_money_sql. In which case the money database function migrations would fail because they were built with varchar accumulators. This release will detect the underlying type of the money_with_currency "amount" element and adjust the migration accordingly. Thanks to @bigardone for the report and motivation to get this done. Closes #36.

Enhancements

  • Adds database functions for unary negation and the operation -. Thanks to @zachdaniel for the PR.

Money SQL version 1.9.3

01 Oct 02:50

Choose a tag to compare

Bug Fixes

  • Return an error is loading invalid amounts such as Inf and NaN. Thanks to @dhedlund for the report and PR. Closes #34.

Money SQL version 1.9.2

12 Jul 01:09

Choose a tag to compare

Embedded Schema Configuration

Please ensure that if you are using Ecto embedded schemas that include a money type that it is configured with the type Money.Ecto.Map.Type, NOT Money.Ecto.Composite.Type.

In previous releases the misconfiguration of the type worked by accident. In this release and subsequent releases you will likely see an exception like ** (Protocol.UndefinedError) protocol Jason.Encoder not implemented for {"USD", Decimal.new("50.00")} of type Tuple. This is most likely an indication of type misconfiguration in an embedded schema.

Bug Fixes

  • Fixes dumping and loading of Money.Ecto.Map.Type when used in embedded schemas. Many thanks to @redrabbit for the issue and the PR. Closes #32.

Money SQL version 1.9.1

12 May 11:51

Choose a tag to compare

Bug Fixes

  • Fixes casting a map when the "amount" is nil. Thanks to @treere for the report and PR. Closes #30.

Cldr Money SQL version 1.9.0

28 Apr 04:59

Choose a tag to compare

Enhancements

  • Adds Money.Ecto.Query.API query helpers to simplify Ecto queries involving money columns. Thanks very much to @am-kantox for the excellent suggestion and PR.