Skip to content
This repository was archived by the owner on Sep 19, 2022. It is now read-only.

Commit 195a9e8

Browse files
authored
refactor: change aggregation to deal with extra columns
include list of columns that are being inserted into, so that extra columns in the database do not break the aggregation
1 parent 5affed4 commit 195a9e8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/DatabaseCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ public function aggregate()
135135
$msg = 'Aggregating daily statistics per ' . implode(' and ', array_filter($ids));
136136
Logger::info($msg);
137137
$query = 'INSERT INTO ' . $this->tables[self::TABLE_SUM] . ' '
138-
. 'SELECT NULL, YEAR(`day`), MONTH(`day`), DAY(`day`), ';
138+
. '(`year`,`month`,`day`,idpId,spId,logins,users) '
139+
. 'SELECT YEAR(`day`), MONTH(`day`), DAY(`day`), ';
139140
foreach ($ids as $id) {
140141
$query .= ($id === null ? '0' : $id) . ',';
141142
}

0 commit comments

Comments
 (0)