* Convert datetime to datetime(0) for dm when install zentao.

This commit is contained in:
songchenxuan
2023-06-20 10:42:02 +08:00
parent e604129a75
commit 12d6a65fcf
2 changed files with 10 additions and 7 deletions
+10
View File
@@ -423,6 +423,16 @@ class installModel extends model
$table = str_replace('`ztv_', $this->config->db->name . '.`ztv_', $table);
$table = str_replace('zt_', $this->config->db->prefix, $table);
if($this->config->db->driver != 'mysql')
{
/* Convert "date" datetime to "date" datetime(0) to fix bug 25725, dm database datetime default 6 */
preg_match_all('/"[0-9a-zA-Z]+" datetime/', $table, $datetimeMatch);
if(!empty($datetimeMatch))
{
foreach($datetimeMatch[0] as $match) $table = str_replace($match, $match . '(0)', $table);
}
}
$this->dbh->exec($table);
}
}