Skip to content

Conversation

@pyramation
Copy link
Contributor

@pyramation pyramation commented Jan 28, 2026

refactor: replace tokens_module with sessions_module in export

Summary

Updates the export functionality to use the new sessions_module instead of the deprecated tokens_module. This is part of the session-centric auth migration where all authentication tokens now live in session_credentials table instead of api_tokens.

Changes:

  • Replace tokens_module with sessions_module in tableOrder array (export-migrations.ts)
  • Replace tokens_module config with sessions_module config with new field structure (export-meta.ts)
  • Replace tokens_table_id with sessions_table_id and session_credentials_table_id in rls_module config
  • Replace tokens_table_id with sessions_table_id and session_credentials_table_id in user_auth_module config (also added missing audits_table_id, audits_table_name, verify_password_function, check_password_function)
  • Replace tokens_table_id with sessions_table_id and session_credentials_table_id in crypto_auth_module config

Review & Testing Checklist for Human

  • Verify dependent PRs are merged first: This requires constructive-db PR #458 and pgpm-modules PR #39 to be merged, otherwise exports will fail
  • Verify field configs match actual table schemas: Compare the fields in rls_module, user_auth_module, crypto_auth_module, and sessions_module configs against the actual table definitions in constructive-db to ensure they match exactly
  • Test an actual export: Run generate:constructive or similar export command after dependent PRs are merged to verify the export works end-to-end

Notes

  • The test file packages/csv-to-pg/__tests__/export.test.ts still uses tokens_module as an example table name for parser tests - this is just a test fixture and doesn't affect functionality
  • The __fixtures__/output/schemas/services_public.ts file will need to be regenerated after the dependent PRs are merged

Link to Devin run: https://app.devin.ai/sessions/d30b2724020f43f6b94865bbd5cf71c6
Requested by: Dan Lynch (@pyramation)

- Replace tokens_module with sessions_module in tableOrder (export-migrations.ts)
- Replace tokens_module config with sessions_module config (export-meta.ts)
- Remove tokens_table_id from rls_module config
- Remove tokens_table_id from user_auth_module config
- Update crypto_auth_module to use sessions_table_id and session_credentials_table_id
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

…dule and user_auth_module configs

- Add sessions_table_id and session_credentials_table_id to rls_module config
- Add sessions_table_id and session_credentials_table_id to user_auth_module config
- Add missing audits_table_id, audits_table_name, verify_password_function, check_password_function to user_auth_module
@pyramation pyramation merged commit 4d731b7 into main Jan 28, 2026
52 checks passed
@pyramation pyramation deleted the devin/1769596779-sessions-export branch January 28, 2026 11:20
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