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 Sep 13, 2024
1 parent 853b6ce commit 042a751
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 042a751

Please sign in to comment.