infisical
infisical copied to clipboard
Fix: Check if junction table exists before creation #2277
This pull request addresses the issue #2277, where the createJunctionTable
function in utils.ts
does not check if a table already exists before attempting to create it. The following changes have been made:
- Table Existence Check: Added a check to ensure the junction table does not already exist before creating it. This prevents potential errors when the table already exists.
- Optional Indexing: Implemented optional indexing on the primary keys for larger tables to improve query performance.
-
Improved Error Handling: Enhanced error handling in the
dropOnUpdateTrigger
,createOnUpdateTrigger
,dropUpdatedAtTriggerFunction
, andcreateUpdateAtTriggerFunction
functions for better debugging and maintenance.