Skip to content

Conversation

@avirajsingh7
Copy link
Collaborator

Summary

This PR replaces the UUID primary key in the User model with an auto-incrementing Integer ID. This change ensures consistency across the application, as most models and APIs rely on integer-based identifiers.

Target issue is #108

Key Changes

  • Migrated user.id from UUID to INT using a dedicated mapping table (uuid_to_int_map) to preserve referential integrity.
  • Updated all foreign key references to user.id in related tables (document, collection, projectuser, apikey) from UUID to INT.
  • Added a new user_id_seq sequence to support auto-increment behavior for user.id.
  • Re-established all dropped constraints and foreign keys.
  • Ensured the migration maintains data integrity through controlled updates.

Affected Areas

  • Database schema and Alembic migration logic.
  • Any code depending on the User model’s ID type.
  • Tests referencing user IDs.

Checklist

Before submitting a pull request, please ensure that you mark these task.

  • Ran fastapi run --reload app/main.py or docker compose up in the repository root and test.
  • If you've fixed a bug or added code that is tested and has test cases.

Notes

Please add here if any other information is required for the reviewer.

@codecov
Copy link

codecov bot commented Jun 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@avirajsingh7 avirajsingh7 added enhancement New feature or request ready-for-review labels Jun 13, 2025
@AkhileshNegi AkhileshNegi requested review from AkhileshNegi and nishika26 and removed request for nishika26 June 13, 2025 10:43
@Ishankoradia Ishankoradia self-requested a review June 16, 2025 06:08
@AkhileshNegi AkhileshNegi merged commit 671d384 into main Jun 16, 2025
2 checks passed
@AkhileshNegi AkhileshNegi deleted the fix/user_id_to_int branch June 16, 2025 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ready-for-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants