Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: integration should be unique per environment
The unique constraint for integration is for unique_key, environment_id and deleted_at which can be null. However null values are not considered equal by default by postgres. :/ from postgres doc at https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-UNIQUE-CONSTRAINTS > By default, two null values are not considered equal in this comparison. That means even in the presence of a unique constraint it is possible to store duplicate rows that contain a null value in at least one of the constrained columns. This behavior can be changed by adding the clause NULLS NOT DISTINCT
- Loading branch information