diff --git a/src/ORM/FieldType/DBForeignKey.php b/src/ORM/FieldType/DBForeignKey.php index 5071e83e8..d8afaab8c 100644 --- a/src/ORM/FieldType/DBForeignKey.php +++ b/src/ORM/FieldType/DBForeignKey.php @@ -98,6 +98,8 @@ class DBForeignKey extends DBInt $dataQuery->setSelect(['over_threshold' => 'count(*) > ' . (int) $threshold]); $result = $dataQuery->execute()->column('over_threshold'); + + // Checking for 't' supports PostgreSQL before silverstripe/postgresql@2.2 $overThreshold = !empty($result) && ($result[0] === 't' || (int) $result[0] === 1); static::$foreignListCache[$hasOneClass] = [