infisical icon indicating copy to clipboard operation
infisical copied to clipboard

Fix: Check if junction table exists before creation #2277

Open khushalmajoka opened this issue 6 months ago • 0 comments

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, and createUpdateAtTriggerFunction functions for better debugging and maintenance.

khushalmajoka avatar Aug 12 '24 15:08 khushalmajoka