mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-30 01:04:12 +02:00
Import: allow for differing imports w/o new rows
This commit is contained in:
parent
af021b06ac
commit
3dfec6b8bd
@ -76,22 +76,14 @@ class Import
|
|||||||
$newRows = $this->newChecksums('imported_row', $rowSums);
|
$newRows = $this->newChecksums('imported_row', $rowSums);
|
||||||
$newProperties = $this->newChecksums('imported_property', array_keys($props));
|
$newProperties = $this->newChecksums('imported_property', array_keys($props));
|
||||||
|
|
||||||
if (! empty($newProperties) || ! empty($newRows)) {
|
$db->insert('imported_rowset', array('checksum' => $rowset));
|
||||||
|
|
||||||
foreach ($newProperties as $checksum) {
|
foreach ($newProperties as $checksum) {
|
||||||
$db->insert('imported_property', $props[$checksum]);
|
$db->insert('imported_property', $props[$checksum]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->insert('imported_rowset', array('checksum' => $rowset));
|
|
||||||
|
|
||||||
foreach ($newRows as $checksum) {
|
foreach ($newRows as $checksum) {
|
||||||
$db->insert('imported_row', $rows[$checksum]);
|
$db->insert('imported_row', $rows[$checksum]);
|
||||||
$db->insert(
|
|
||||||
'imported_rowset_row',
|
|
||||||
array(
|
|
||||||
'rowset_checksum' => $rowset,
|
|
||||||
'row_checksum' => $checksum
|
|
||||||
)
|
|
||||||
);
|
|
||||||
foreach ($rowsProps[$checksum] as $propChecksum) {
|
foreach ($rowsProps[$checksum] as $propChecksum) {
|
||||||
$db->insert('imported_row_property', array(
|
$db->insert('imported_row_property', array(
|
||||||
'row_checksum' => $checksum,
|
'row_checksum' => $checksum,
|
||||||
@ -99,6 +91,15 @@ class Import
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (array_keys($rows) as $checksum) {
|
||||||
|
$db->insert(
|
||||||
|
'imported_rowset_row',
|
||||||
|
array(
|
||||||
|
'rowset_checksum' => $rowset,
|
||||||
|
'row_checksum' => $checksum
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$db->insert(
|
$db->insert(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user