Skip to content

Conversation

@CarlyAThomas
Copy link
Contributor

Please note:
⚠️ Depends on: PR #569 - Please review and merge that PR first.

Changes made:

  • Added migration: 20251207074104_add_refresh_token_expires_in
  • Adds refresh_token_expires_in INTEGER column to Account table
  • Aligns database schema with Prisma schema definition

Checklist:

This PR is not associated with an issue.

Problem

The refresh_token_expires_in field exists in the Prisma schema but has no migration to create it in the database, causing schema drift.

  • The field is defined in schema.prisma in the Account model (line 38)
  • No migration exists to add this column to the database
  • Causes drift warnings when running Prisma commands

Solution

Create a migration to add the missing column to the Account table.

Purpose

This field is part of the OAuth 2.0 specification and is used by NextAuth.js to:

  • Store the expiration time (in seconds) for OAuth refresh tokens
  • Manage token refresh lifecycle for OAuth providers (Auth0, GitHub)
  • Determine when refresh tokens need to be renewed

The field is automatically populated by the NextAuth PrismaAdapter when users authenticate through OAuth providers. While not currently utilized for automatic token refresh in the application, it's a standard field in the NextAuth Account schema and ensures compatibility with future OAuth enhancements.

Impact

  • Resolves Account table schema drift
  • Enables proper OAuth token expiration tracking
  • Maintains NextAuth schema compatibility

- Removed isAdminApproved field that was causing schema drift
- Field was in migration but not in schema.prisma
- Resolves database sync issues
- Added missing migration for refresh_token_expires_in field
- Field exists in schema.prisma but was missing from database
- Resolves Account table schema drift
@CarlyAThomas CarlyAThomas requested a review from a team as a code owner December 7, 2025 22:30
@CarlyAThomas CarlyAThomas mentioned this pull request Dec 7, 2025
2 tasks
@NewtonLC NewtonLC closed this Dec 9, 2025
@CarlyAThomas CarlyAThomas deleted the fix/add-refresh-token-expires-in-migration branch December 9, 2025 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants