Releases: ex-money/money_sql
Money SQL version 2.0.0
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_money6.0. -
Supported on Elixir 1.17 or later only.
-
Requires
ex_money ~> 6.0, which replaces theex_cldrfamily of dependencies with the unified localize package. As a result, the CLDR backend module (e.g.MyApp.Cldr) and the:default_cldr_backendconfiguration key are no longer used. Configure locales viaconfig :localizeinstead. See the ex_money 6.0 migration guide for details. -
The error message format for
Money.UnknownCurrencyErrornow follows theex_money 6.0convention (for example"The currency :AAA is not known."). Tests asserting on the previous message text will need to be updated. -
jasonis no longer a declared dependency. Postgrex defaults toJasonforjson/jsonbcolumns; configureconfig :postgrex, :json_library, JSON(Elixir 1.18+) and runmix deps.compile postgrex --forceonce since Postgrex captures this setting at compile time.
Money SQL version 1.12.0
Enhancements
- Adds
avgSQL function for both Postgres and MySQL. Thanks very much to @peaceful-james for the PR. Closes #44.
Money SQL version 1.11.1
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
Enhancements
- When dumping a
Money.Ecto.Composite.Type, detect ifdump/3is being called byEcto.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
Bug Fixes
-
Fix compilation warnings on Elixir 1.16.
-
Fix migration generator for
money_with_currencytype. Thanks to @bigardone for the issue and PR. Closes #37, closes #38.
Money SQL version 1.10.0
Bug Fixes
- The mix tasks that generate database function migrations (
money.gen.postgres.sum_function,money.gen.postgres.plus_operatorandmoney.gen.postgres.min_max_functions) need to be aware of the type of themoney_with_currency"amount" element in a Postgres database. In releases ofex_money_sqlup to 1.7.1 the type waschar(3). In later releases is changed to the more canonicalvarchar. 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 themoney_with_currencytype aschar(3)and then move to a later release ofex_money_sql. In which case the money database function migrations would fail because they were built withvarcharaccumulators. This release will detect the underlying type of themoney_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
Money SQL version 1.9.2
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.Typewhen used in embedded schemas. Many thanks to @redrabbit for the issue and the PR. Closes #32.
Money SQL version 1.9.1
Cldr Money SQL version 1.9.0
Enhancements
- Adds
Money.Ecto.Query.APIquery helpers to simplify Ecto queries involving money columns. Thanks very much to @am-kantox for the excellent suggestion and PR.