Adding comment about the === 't' condition for supporting postgres

This commit is contained in:
Guy Marriott 2019-04-16 12:10:13 +12:00
parent a48beac845
commit 7fd6e14423
No known key found for this signature in database
GPG Key ID: A80F9ACCB86D3DA7
1 changed files with 2 additions and 0 deletions

View File

@ -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] = [