fix: correct user_profiles column name in grace-period job (refs #58)
All checks were successful
Deploy to Staging / Build Images (pull_request) Successful in 3m9s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 29s
Deploy to Staging / Verify Staging (pull_request) Successful in 7s
Deploy to Staging / Notify Staging Ready (pull_request) Successful in 7s
Deploy to Staging / Notify Staging Failure (pull_request) Has been skipped

The grace-period job was using 'user_id' to query user_profiles table,
but the correct column name is 'auth0_sub'. This would cause the tier
sync to fail during grace period auto-downgrade.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Eric Gullickson
2026-01-19 09:53:45 -06:00
parent 2c0cbd5bf7
commit 8c86d8d492

View File

@@ -78,13 +78,13 @@ export async function processGracePeriodExpirations(): Promise<GracePeriodResult
await client.query(updateQuery, [subscription.id]); await client.query(updateQuery, [subscription.id]);
// Sync tier to user_profiles table // Sync tier to user_profiles table (user_id is auth0_sub)
const syncQuery = ` const syncQuery = `
UPDATE user_profiles UPDATE user_profiles
SET SET
subscription_tier = 'free', subscription_tier = 'free',
updated_at = NOW() updated_at = NOW()
WHERE user_id = $1 WHERE auth0_sub = $1
`; `;
await client.query(syncQuery, [subscription.user_id]); await client.query(syncQuery, [subscription.user_id]);