This commit is contained in:
walkor 2022-12-26 15:53:10 +08:00
parent b5ca8b20b1
commit 8dc51585e8

View File

@ -78,17 +78,17 @@ class InstallController extends Base
'wa_uploads',
];
if (!$overwrite) {
$tables_exist = [];
foreach ($tables as $table) {
$tables_exist[] = current($table);
}
$tables_conflict = array_intersect($tables_to_install, $tables_exist);
if (!$overwrite) {
if ($tables_conflict) {
return $this->json(1, '以下表' . implode(',', $tables_conflict) . '已经存在,如需覆盖请选择强制覆盖');
}
} else {
foreach ($tables_to_install as $table) {
foreach ($tables_conflict as $table) {
$db->exec("DROP TABLE `$table`");
}
}