Description
Setting constraints is only valid inside a transaction which configures when the key constraints are applied - immediate or deferred.
When we disable/enable constraints, postgres throws a WARNING:
WARNING: SET CONSTRAINTS can only be used in transaction blocks
A solution for this would be simply not emitting the SQL if we're not inside a transaction.
It seems cake has a feature enum that would cover this that's set to false for postgres:
DriverFeatureEnum::DISABLE_CONSTRAINT_WITHOUT_TRANSACTION => false,
CakePHP Version
5.4
PHP Version
8.5
Description
Setting constraints is only valid inside a transaction which configures when the key constraints are applied - immediate or deferred.
When we disable/enable constraints, postgres throws a WARNING:
A solution for this would be simply not emitting the SQL if we're not inside a transaction.
It seems cake has a feature enum that would cover this that's set to false for postgres:
DriverFeatureEnum::DISABLE_CONSTRAINT_WITHOUT_TRANSACTION => false,CakePHP Version
5.4
PHP Version
8.5