Releases: kipcole9/money_sql
Releases · kipcole9/money_sql
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.
Money SQL version 1.7.3
Bug Fixes
- When loading money from the database with the
Money.Ecto.Map.Typetype, do not do localized parsing of the amount. The amount is always saved usingDecimal.to_string/1and therefore is not localized. It must not be parsed with localization on loading.