Skip to content

IAV-1331/fix(credential): allow duplicate (credential_id, instance_name) for credential replication

salaheddine zidani a demandé de fusionner feature/IAV-1331 vers develop

Summary

Removes the @UniqueConstraint on (credential_id, instance_name) from the credential_instances table to support credential replication within the same N8N instance.

Context & Motivation

The customer-care N8N instance requires two separate CredentialInstance records pointing to the same Credential under the same instance_name. This replication pattern is intentional — both instances consume identical credentials but are registered as distinct deployment slots.

The previous unique constraint blocked this use case at the database level, causing a constraint violation when the second CredentialInstance was persisted.

Impact

  • No schema migration needed beyond dropping the existing unique index credential_instances(credential_id, instance_name).
  • Uniqueness enforcement, if still required for other scenarios, must now be handled at the service/application layer.
  • No functional regression expected for existing single-instance deployments.

Rapports de requête de fusion