Releases: kipcole9/money_sql
Releases · kipcole9/money_sql
Money SQL version 1.11.0
Enhancements
- When dumping a
Money.Ecto.Composite.Type
, detect ifdump/3
is 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_currency
type. 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_operator
andmoney.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_sql
up 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_currency
type 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 withvarchar
accumulators. 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.Type
when 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.API
query helpers to simplify Ecto queries involving money columns. Thanks very much to @am-kantox for the excellent suggestion and PR.
Money SQL version 1.7.3
Bug Fixes
- When loading money from the database with the
Money.Ecto.Map.Type
type, do not do localized parsing of the amount. The amount is always saved usingDecimal.to_string/1
and therefore is not localized. It must not be parsed with localization on loading.
Money SQL version 1.7.2
Bug Fixes
- Makes the aggregate functions parallel-safe which provides up to 100% speed improvement. Thanks to @milangupta1 for the PR.