35 $GLOBALS[
'MIG_4041_TOTAL_RECORDS'] = 0;
44 global $MIG_4041_TOTAL_RECORDS;
45 if ($dbManager == NULL) {
46 echo
"No connection object passed!\n";
60 $sql =
"SELECT count(*) AS cnt FROM $table " .
61 "WHERE hash = 'd41d8cd98f00b204e9800998ecf8427e';";
62 $result = $dbManager->getSingleRow($sql, [],
63 __METHOD__ .
".checkMig." . $table);
64 $count += intval($result[
'cnt']);
66 $MIG_4041_TOTAL_RECORDS = $count;
82 global $MIG_4041_TOTAL_RECORDS;
85 $sql =
"WITH temp_h AS (" .
86 "UPDATE $table SET " .
87 "content = NULL, hash = NULL " .
89 "hash = 'd41d8cd98f00b204e9800998ecf8427e' OR content = ''" .
90 ") RETURNING 1 AS c) " .
91 "SELECT sum(c) AS cnt FROM temp_h;";
92 $statement = __METHOD__ .
".fixHash." . $table;
94 $result = $dbManager->getSingleRow($sql, [], $statement);
96 $updated += intval($result[
'cnt']);
98 echo
"*** Corrected hash of $updated/$MIG_4041_TOTAL_RECORDS entries from " .
114 }
catch (Exception $e) {
115 echo
"Something went wrong. Try running postinstall again!\n";
116 $dbManager->rollback();
DB_TableExists($tableName)
Check if table exists.
fixEmptyContentHash($dbManager)
checkMigrate4041Required($dbManager)
Migrate_40_41($dbManager)