Skip to content

Commit

Permalink
DirectorDatalist: Match column types to join tables in postgres by ex…
Browse files Browse the repository at this point in the history
…plicit type casting
  • Loading branch information
raviks789 committed Oct 22, 2024
1 parent a6da978 commit 9b81fca
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion library/Director/Objects/DirectorDatalist.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ protected function isInUse(): bool

$db = $this->getDb();

if ($this->getConnection()->getDbType() === 'pgsql') {
$datalistJoin = 'l.id = CAST(dfs.setting_value AS INTEGER)';
} else {
$datalistJoin = 'l.id = dfs.setting_value';
}

$dataFieldsCheck = $db->select()
->from(['df' => 'director_datafield'], ['varname'])
->join(
Expand All @@ -103,7 +109,7 @@ protected function isInUse(): bool
)
->join(
['l' => 'director_datalist'],
'l.id = dfs.setting_value',
$datalistJoin,
[]
)
->where('datatype = ?', DataTypeDatalist::class)
Expand Down

0 comments on commit 9b81fca

Please sign in to comment.