Remove PostgreSQL Extensions and Implement Case-Insensitive Handling#1872
Merged
ZeekoZhu merged 4 commits intomerico-ai:mainfrom Jan 6, 2026
Merged
Remove PostgreSQL Extensions and Implement Case-Insensitive Handling#1872ZeekoZhu merged 4 commits intomerico-ai:mainfrom
ZeekoZhu merged 4 commits intomerico-ai:mainfrom
Conversation
d9d473c to
fdebafa
Compare
… uuid-ossp) - Replace pgcrypto/uuid-ossp with custom gen_random_uuid() SQL function - Disable citext extension (replaced with VARCHAR + application-layer handling) - Change account.name, account.email, api_key.name from citext to VARCHAR 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…pi_key Replace citext extension behavior with application-layer handling: - account.name and account.email: use LOWER() for login, toLowerCase() for INSERT/UPDATE - api_key.name: use toLowerCase() for INSERT and existence check Fixes test validation for merico_metric_system type. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
fdebafa to
541db58
Compare
… api_key - Add migration to create LOWER() based unique indexes for account.name, account.email, and api_key.name - Update account.service.ts to use SQL LOWER() for case-insensitive queries instead of toLowerCase() - Update api.service.ts to use SQL LOWER() for case-insensitive name check - Add integration tests for case-insensitive uniqueness constraints 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1872 +/- ##
=======================================
Coverage ? 85.09%
=======================================
Files ? 116
Lines ? 3463
Branches ? 334
=======================================
Hits ? 2947
Misses ? 516
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
This pull request includes several important changes to our codebase. The primary goals of these changes are to optimize our code structure, improve functionality, and enhance the robustness and usability of our system.
Key Changes:
Migration Script Adjustments:
pgcrypto,uuid-ossp, andcitexthave been removed from the migration scripts. This change simplifies our database setup and reduces dependencies on specific PostgreSQL extensions.namefields in the user and API key tables have been changed fromcitexttoVARCHAR. This change is necessary to support case-insensitive handling of these fields.Service Functionality Updates:
nameandemailfields in a case-insensitive manner. This ensures that user interactions are more flexible and user-friendly.namefield in a case-insensitive manner. This prevents the creation of duplicate API keys with the same name but different cases.Test Updates:
typefield in the tests have been expanded to includemerico_metric_system, ensuring that our tests cover the new functionality comprehensively.Impact:
These changes will improve the overall stability and performance of our system. By removing unnecessary PostgreSQL extensions and implementing case-insensitive handling, we enhance the user experience and simplify our database schema. The updated tests ensure that our new functionality is thoroughly validated.
Testing:
All changes have been thoroughly tested to ensure that they do not introduce any regressions. The updated migration scripts, service logic, and tests have been verified to work correctly in our development environment.
Conclusion:
This pull request represents a significant step forward in optimizing our codebase and improving our system's functionality. By removing PostgreSQL extensions and implementing case-insensitive handling, we make our system more robust and user-friendly. I recommend merging these changes to take advantage of these improvements.
Review Request:
I would appreciate a thorough review of these changes to ensure they meet our standards and do not introduce any unforeseen issues. Please let me know if you have any questions or concerns.
Thank you for your attention to this pull request.