From 7fd6e14423dca2f9ff21d90146630f03c3af53bb Mon Sep 17 00:00:00 2001 From: Guy Marriott Date: Tue, 16 Apr 2019 12:10:13 +1200 Subject: [PATCH] Adding comment about the === 't' condition for supporting postgres --- src/ORM/FieldType/DBForeignKey.php | 2 ++ 1 file changed, 2 insertions(+) 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] = [