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);
|
||||
$newProperties = $this->newChecksums('imported_property', array_keys($props));
|
||||
|
||||
if (! empty($newProperties) || ! empty($newRows)) {
|
||||
$db->insert('imported_rowset', array('checksum' => $rowset));
|
||||
|
||||
foreach ($newProperties as $checksum) {
|
||||
$db->insert('imported_property', $props[$checksum]);
|
||||
}
|
||||
|
||||
$db->insert('imported_rowset', array('checksum' => $rowset));
|
||||
|
||||
foreach ($newRows as $checksum) {
|
||||
$db->insert('imported_row', $rows[$checksum]);
|
||||
$db->insert(
|
||||
'imported_rowset_row',
|
||||
array(
|
||||
'rowset_checksum' => $rowset,
|
||||
'row_checksum' => $checksum
|
||||
)
|
||||
);
|
||||
foreach ($rowsProps[$checksum] as $propChecksum) {
|
||||
$db->insert('imported_row_property', array(
|
||||
'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(
|
||||
|
|
Loading…
Reference in New Issue