Uh oh!
There was an error while loading. Please reload this page.
V185: currency-freeze columns on carts, cart items and orders (stacked on #785) - #787
Merged
Merged
Conversation
timujinne
commented
Sep 6, 2026
timujinne
left a comment
ContributorAuthor
There was a problem hiding this comment.
Independent review (read-only reviewer, separate from the author), range 2fe7f3a5..6668c93f. Verdict: PASS, no findings against V185.
Verified directly
- Six
ADD COLUMN IF NOT EXISTSstatements match the spec (types, nullability, no defaults); the three backfills derive every value from theis_defaultrow (1.0 for base-currency records, the table rate otherwise, NULL when unknown;base_unit_price/base_totalonly for base-currency records), all gatedWHERE … IS NULLfor idempotency; theDOblock raises before any column is touched unless exactly one default exists;down/1drops the six and stamps 184. - Manifest entries hand-declared under the existing "DECLARED POST-GENERATION" lane (V165/V168/V171/V175 precedent); positions and types cross-checked against the live
information_schema.columns— exact match;backfill: nilis the right analogue of V183'starget_uuid(no column default).chain_hashrestamped (7aef0122…),release_checkMigration Version Sync passes (V135..V185 contiguous, 51 files). - Tests rerun: migrations dir + release_check tests 16 doctests / 450 tests / 0 failures;
expected_schema/67/0;format --check-formattedandcredo --strictclean. The "two defaults" test drops billing's partial index inside its sandboxed transaction so V185's own guard is what fires — legitimate. - Live host after
phoenix_kit_update_v184_to_v185: 94/94 cartsUSD/1.000000, 11/11 itemsbase_unit_price = unit_price, the one orderbase_total = total, marker 185, all domains 200. - Commit by the author only; no version/CHANGELOG changes.
Note, not a blocker: the merge that carried this onto the host's stand branch also pulled four unrelated upstream commits (2.15.0 release, B2B registration setting, admin naming); the two behaviour changes 2.15.0 flags (user_dashboard_enabled default, admin_path wording) do not affect that host.
timujinne
marked this pull request as ready for review
September 6, 2026 09:02
ddon
commented
Sep 6, 2026
Contributor
@timujinne and another conflict is here |
ddon
commented
Sep 6, 2026
Contributor
@timujinne still conflict here |
Adds base_currency/exchange_rate to phoenix_kit_shop_carts and phoenix_kit_orders, and base_unit_price to phoenix_kit_shop_cart_items - all nullable, no default. Renumbered V185 -> V186 on rebase: BeamLabEU#786 landed its own V185 first (permanent activities and the settings history), so this migration moves up one. postgres.ex's @current_version was 185 on BOTH sides, so git merged that line clean and the chain would have stopped one short of this migration; bumped to 186 by hand. expected_schema.ex's object lists merged cleanly and carry both sets; @chain_hash recomputed over the merged 52-file chain and verified with release_check. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XETjfiAv8Vom2tWhKnKQGC
ddonforce-pushed
the
feature/currency-e1-core
branch
from
September 6, 2026 19:23
6668c93 to
a42ffb9Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
V185: currency-freeze columns on carts, cart items and orders
Stacked on #785 (V184). Companions: BeamLabEU/phoenix_kit_billing#32 and the ecommerce stage-Э1 PR, which read these columns through their schemas (
Order,Cart,CartItem).What V185 does
phoenix_kit_shop_carts:base_currency varchar(3),exchange_rate numeric(15,6);phoenix_kit_shop_cart_items:base_unit_price numeric(15,2);phoenix_kit_orders:base_currency varchar(3),exchange_rate numeric(15,6),base_total numeric(15,2). All nullable, no default —ADD COLUMN IF NOT EXISTS, no table rewrite.DOblock raises unlessphoenix_kit_currencieshas exactly oneis_defaultrow (the billing chain's V2 partial unique index guarantees it; the guard makes the failure visible before any backfill).base_currencyfrom theis_defaultrow;exchange_rate= 1.0 when the record's currency is the base, else that currency's table rate (NULL when unknown — honest "unknown rate");base_unit_price/base_totalonly for records already in the base currency, NULL otherwise (a conversion nobody performed is not fabricated).down/1drops the six columns and stamps 184 — irreversible in meaning (orders forget the rate they were priced at), said in the comment.expected_schema.ex: the six columns are declared by hand (V171 "DECLARED POST-GENERATION" precedent; positions/types from the liveordinal_position), thenchain_hashrestamped — the full generator aborts on this environment (see V184: remove the dead shop_currency setting #785 for thesync_shop_*_slugsmode-shape mismatch).Tests
test/phoenix_kit/migrations/v185_test.exs(backfill from the default row; refusal with two defaults). Migrations dir + release_check tests: 16 doctests, 450 tests, 0 failures;expected_schema/tests 67/0;mix phoenix_kit.release_checkMigration Version Sync passes (V135..V185 contiguous, chain hash over 51 files). Applied on a live host: 94/94 carts backfilledUSD/1.000000, 11/11 itemsbase_unit_price = unit_price, the one orderbase_total = total, marker 185. Version bump and CHANGELOG left to the maintainer.