chore(payments): deploy manual-payouts + related migrations to cloud (#500) - #508
Merged
Merged
Conversation
…migrations to cloud Applies three previously-local-only migrations to the cloud Supabase project (20260724120000_manual_payouts, 20260724130000_access_cutoff_enforcement, 20260724140000_transaction_split_snapshot) and repairs migration history to match the repo filenames. Regenerates lib/database.types.ts for the columns each adds (payouts.payout_method/note/recorded_by + nullable period_start/ period_end, transactions.school_percentage_snapshot). Deploying the latter two (beyond #500's manual_payouts scope) was necessary because getPayoutsOwed() already selects transactions.school_percentage_snapshot on every /platform/payouts load — that column didn't exist on cloud, so the page was erroring in production before this change. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CcZgbBpQtpKipPwQq38EjT
guillermoscript
marked this pull request as ready for review
July 24, 2026 18:37
Fixes pre-existing type drift unrelated to any migration in this branch — the checked-in types file was stale relative to migrations already deployed to both local and cloud: adds lessons.transcript, subscriptions.superseded_by (+ FK), the user_ui_state table, and the change_subscription_plan RPC return shape; removes the handle_manual_subscription_expiry function type (dropped by migration 20260719120000/20260719130000, confirmed no live callers — the app-layer cron at app/api/cron/expire-platform-subscriptions/route.ts replaced it). Also picks up the current typegen format (adds __InternalSupabase version marker, drops the empty graphql_public schema block) — nothing in the codebase references graphql_public. npm run typecheck, lint, and build all pass clean. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CcZgbBpQtpKipPwQq38EjT
Owner
Author
|
Merged as Shipped:
QA that passed:
Nothing deferred beyond this PR's scope. |
This was referenced Jul 24, 2026
Closed
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.
Description
Deploys
20260724120000_manual_payouts.sqlto the cloud Supabase project (per #500) and regenerateslib/database.types.tsfor the columns it adds.While smoke-testing, found that
/platform/payouts(getPayoutsOwed()inapp/actions/platform/payouts.ts) already selectstransactions.school_percentage_snapshot— a column from20260724140000_transaction_split_snapshot.sql(#496, merged to master) that was also cloud-only-missing. That means the payouts page was erroring in production before this change.tenants.access_cutoff_at(20260724130000_access_cutoff_enforcement.sql, #494) was in the same state. All three are simple additiveALTER TABLEs with no interdependency, so — after confirming with the repo owner — this PR deploys all three together rather than leaving production broken between #500 and separate deploy issues for #494/#496 (neither of which exists yet).Changes made
manual_payouts,access_cutoff_enforcement,transaction_split_snapshot.supabase_migrations.schema_migrations) so each version/name matches the repo filename exactly.lib/database.types.tsfully against cloud (two commits: the first applied just the affected columns for these three migrations, the second did a full regen to also fix pre-existing type drift found while reviewing the diff — see below). No code changes needed elsewhere;npm run typecheck,lint, andbuildall pass clean.lessons.transcript,subscriptions.superseded_by(+ FK), theuser_ui_statetable, and thechange_subscription_planRPC return shape; removes the deadhandle_manual_subscription_expiryfunction type (dropped by migration20260719130000, confirmed no live callers — replaced by the app-layer cron atapp/api/cron/expire-platform-subscriptions/route.ts); and picks up the current typegen output format (adds the__InternalSupabaseversion marker, drops the emptygraphql_publicschema block — nothing in the codebase references it).Type of change
/platform/payoutswas erroring on the missingschool_percentage_snapshotcolumn)Relationship
Closes #500
Testing
npm run typecheck— passes clean on the changed file.payoutshaspayout_method/note/recorded_by,period_start/period_endnullable — matches local.mcp__supabase-cloud__get_advisors(security)— no new findings referencingpayouts,access_cutoff_at,has_course_access, ortransactions. RLS policies onpayoutsare row-level only (tenant_id/is_super_admin), unaffected by new columns.getPayoutsOwed()against cloud — executes cleanly (0 rows currently, no live PayPal/Binance/LemonSqueezy transactions in production yet, but no longer errors on the missing column).markPayoutPaid()against cloud insideBEGIN...ROLLBACK— succeeds, no data persisted (count(*) = 0confirmed after)./platform/payoutsUI code is unchanged.QA verification steps
/platform/payoutsin production (or against the cloud project) and confirm the page renders without a server error (previously would 500 on the missingschool_percentage_snapshotcolumn).payoutswithpayout_method = 'manual',recorded_byset to your user id, and (if provided)notepopulated.supabase migration list(ormcp__supabase-cloud__list_migrations) shows20260724120000_manual_payouts,20260724130000_access_cutoff_enforcement, and20260724140000_transaction_split_snapshotall present with versions matching the repo filenames.