diff --git a/app/Http/Controllers/SetupController.php b/app/Http/Controllers/SetupController.php index 50ca9405..6a809d07 100644 --- a/app/Http/Controllers/SetupController.php +++ b/app/Http/Controllers/SetupController.php @@ -131,21 +131,30 @@ class SetupController extends Controller /** * Check if the given tables exist in current database. * - * @param array $tables [description] + * @param array $tables * @return bool */ public static function checkTablesExist($tables = [ 'users', 'closets', 'players', 'textures', 'options' - ]) - { - foreach ($tables as $table_name) { + ]) { + $totalTables = 0; + + foreach ($tables as $tableName) { // prefix will be added automatically - if (!Schema::hasTable($table_name)) { - return false; + if (Schema::hasTable($tableName)) { + $totalTables++; } } - return true; + if ($totalTables == count($tables)) { + return true; + } else { + // not installed completely + foreach (array_merge($tables, ['migrations']) as $tableName) { + Schema::dropIfExists($tableName); + } + return false; + } } public static function checkTextureDirectory() diff --git a/resources/lang/zh_CN/setup.yml b/resources/lang/zh_CN/setup.yml index e0e64729..24b90515 100644 --- a/resources/lang/zh_CN/setup.yml +++ b/resources/lang/zh_CN/setup.yml @@ -54,4 +54,4 @@ wizard: finish: title: 安装成功! - success: Blessing Skin Server 安装完成。您是否还沉浸在愉悦的安装过程中?很遗憾,一切皆已完成! :) + text: Blessing Skin Server 安装完成。您是否还沉浸在愉悦的安装过程中?很遗憾,一切皆已完成! :)