Add V129: fix missing subscription_type_uuid column on subscriptions#583
Merged
Conversation
phoenix_kit_subscriptions never actually gained the subscription_type_uuid UUID FK the billing Subscription schema uses: V33 created plan_id (integer), V65 only conditionally *renamed* plan_uuid -> subscription_type_uuid, and plan_uuid never existed. So on a fresh ensure_current/2 build the column was absent and subscription inserts / the Subscriptions LiveView raised undefined_column. Add it idempotently (UUID, FK to phoenix_kit_subscription_types(uuid) ON DELETE SET NULL, partial index), bump @current_version to 129. Verified on a fresh migrate: column + FK + index present, marker = 129.
ddon
pushed a commit
that referenced
this pull request
Jun 5, 2026
retryable?/1 now retries {:ai_error, {:api_error, 429}} as defense-in-depth:
the built-in OpenRouter client maps 429 -> :rate_limited (snoozed), but a
custom/future provider may surface a bare {:api_error, 429}, which is the
canonical retry-after and should retry rather than discard on first attempt.
Also corrects the :timeout clause comment (Completion remaps transport
timeouts to :request_timeout before they reach the worker) and updates the
test (429 now asserts retryable; added a 404 refute).
Updates the PR #582 review doc: 429 item RESOLVED+FIXED with the verified
PhoenixKitAI contract, a dated follow-up section splitting fixed vs
developer-owned items, and a PR #583 (V129) verdict (no issues).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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 free
to 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.
Summary
Fixes a fresh-install defect in
phoenix_kit_subscriptions: thesubscription_type_uuidUUID foreign key thatPhoenixKitBilling.Schemas.Subscriptionuses was never added by any migration.plan_id(later renamed tosubscription_type_idin V65).plan_uuid → subscription_type_uuid— butplan_uuidnever existed, so the rename was a no-op on every fresh build.Result: on a fresh
ensure_current/2, the column is absent, and every subscription insert (and the billing Subscriptions LiveView) raisesPostgrex.Error … undefined_column "subscription_type_uuid". Existing long-lived databases that somehow acquired the column are unaffected. (Surfaced by thephoenix_kit_billingquality sweep, which had to@tag :skipthree subscription tests pending this fix.)Change
New V129 migration, idempotent throughout (guarded DO-blocks):
subscription_type_uuid UUIDtophoenix_kit_subscriptionsphoenix_kit_subscription_types(uuid)ON DELETE SET NULL… WHERE subscription_type_uuid IS NOT NULL@current_versionto 129;down/1drops the index/FK/column and resets the marker to 128.Verification
Fresh migrate (
test.reset+ensure_current) on an empty DB:subscription_type_uuid : uuidpresent ✓phoenix_kit_subscriptions_subscription_type_uuid_fkey✓phoenix_kit_subscriptions_subscription_type_uuid_idx✓COMMENT ON TABLE phoenix_kit=129✓mix formatclean,mix credo --strictclean.No
@version/ CHANGELOG bump (left for the release cut).Follow-up
Once this ships in a release, the three
@tag :skipsubscription tests inphoenix_kit_billingcan be un-skipped.