This commit is contained in:
songchenxuan
2023-06-21 10:31:15 +08:00
parent 41a2204422
commit 1b19258bfc
2 changed files with 7 additions and 10 deletions
+7
View File
@@ -459,6 +459,13 @@ class dbh
$sql = preg_replace('/\,\s*(unique|fulltext)*\s+key[\_\"0-9a-z ]+\(+[\,\_\"0-9a-z ]+\)+/i', '', $sql);
$sql = preg_replace('/ float\s*\(+[\,\_\"0-9a-z ]+\)+/i', ' float', $sql);
/* Convert "date" datetime to "date" datetime(0) to fix bug 25725, dm database datetime default 6 */
preg_match_all('/"[0-9a-zA-Z]+" datetime/', $sql, $datetimeMatch);
if(!empty($datetimeMatch))
{
foreach($datetimeMatch[0] as $match) $sql = str_replace($match, $match . '(0)', $sql);
}
if(strpos($sql, "ALTER TABLE") !== false) $sql = $this->convertAlterTableSql($sql);
}
-10
View File
@@ -423,16 +423,6 @@ 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);
}
}