mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-25 23:04:53 +02:00
DirectorDatalist: Match column types to join tables in postgres by explicit type casting (#2916)
This commit is contained in:
commit
aa1df8d772
@ -94,6 +94,12 @@ class DirectorDatalist extends DbObject implements ExportInterface
|
|||||||
|
|
||||||
$db = $this->getDb();
|
$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()
|
$dataFieldsCheck = $db->select()
|
||||||
->from(['df' => 'director_datafield'], ['varname'])
|
->from(['df' => 'director_datafield'], ['varname'])
|
||||||
->join(
|
->join(
|
||||||
@ -103,7 +109,7 @@ class DirectorDatalist extends DbObject implements ExportInterface
|
|||||||
)
|
)
|
||||||
->join(
|
->join(
|
||||||
['l' => 'director_datalist'],
|
['l' => 'director_datalist'],
|
||||||
'l.id = dfs.setting_value',
|
$datalistJoin,
|
||||||
[]
|
[]
|
||||||
)
|
)
|
||||||
->where('datatype = ?', DataTypeDatalist::class)
|
->where('datatype = ?', DataTypeDatalist::class)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user