Repository navigation
fix: unblock CMS deploy and lock down member access - #206
Merged
Merged
Conversation
A dev run with push enabled writes a 'dev' row to payload_migrations, which makes prodMigrations block on an interactive prompt and hangs every request in production. Schema changes go through migrations.
Create/delete are admin-only, read/update admin-or-self, and members can no longer change role, membershipStatus or membershipExpiryDate. Previously any signed-in member could promote themselves to admin.
- Migration makes event_registrations.phone nullable (registrations no longer send it, so every insert failed) and drops priceType and events.non_member_price, guarded with IF EXISTS for prod's drift - Registration requires an active membership - RSVP page warns non-active members; prices read 'Members only'
Adds GET /stripe/checkout returning the STRIPE_PRICE_ID amount and renders it on the payment step instead of a hardcoded $6.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
What does this PR do?
Gets the backend (Payload CMS) deployable and closes some access gaps found along the way.
Why prod CMS hangs: someone ran
pnpm devagainst the prod DB, sopayload_migrationshas adevrow.prodMigrationsthen waits on an interactive "data loss?" prompt, and every/adminand/api/*request hangs. This PR stops that from happening again. A one-off DB cleanup (below) fixes the current state.push: false). Schema changes must go throughpnpm migrate:create.roletoadminand read every user. Now:role,membershipStatusandmembershipExpiryDate20261011_000001_members_only_events:event_registrations.phonenullable. Since fix/event-rsvp-membership #202 registrations don't send a phone number, so every insert was failing.priceTypeandevents.non_member_priceIF EXISTSguards because prod's schema has driftedGET /stripe/checkoutreturns theSTRIPE_PRICE_IDamount, replacing the hardcodedPAY $6./signupnow renders per request because the CMS isn't reachable during the Docker build.Testing
Everything ran against a throwaway local Postgres, not prod:
migrate:create --skip-emptyfinds no schema drift.tests/int/users.int.spec.tspasses./admin,/api/sponsors,/api/globals/site-settingsand/stripe/checkoutall return 200.role: adminis ignored.Before deploying
The prod DB needs a one-off cleanup or the hang continues:
devrow and the stale20260526_190419row frompayload_migrationsevent_rsvps,20260929_000001_sponsors_categoryand20261008_205511as applied, after checking the schema matchesThe new migration then runs automatically on deploy. Separately,
GOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRETare still missing on Vercel.Type of change
Checklist
feature/,fix/,chore/,hotfix/)Linked Issues
Related to #198, #202