From fc85371b7aa780bcc9abc886f82d31a94edce6ab Mon Sep 17 00:00:00 2001 From: jqh <841324345@qq.com> Date: Tue, 17 Nov 2020 01:08:26 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E8=A1=A8=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2020_09_07_090635_create_admin_settings_table.php | 4 ++-- .../2020_09_22_015815_create_admin_extensions_table.php | 8 ++++---- src/Models/Extension.php | 2 +- src/Models/ExtensionHistory.php | 2 +- src/Models/Setting.php | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/database/migrations/2020_09_07_090635_create_admin_settings_table.php b/database/migrations/2020_09_07_090635_create_admin_settings_table.php index 2c5d7f854..1a050dc18 100644 --- a/database/migrations/2020_09_07_090635_create_admin_settings_table.php +++ b/database/migrations/2020_09_07_090635_create_admin_settings_table.php @@ -23,7 +23,7 @@ public function config($key) */ public function up() { - Schema::create($this->config('database.settings_table'), function (Blueprint $table) { + Schema::create($this->config('database.settings_table') ?: 'admin_settings', function (Blueprint $table) { $table->string('slug', 100)->primary(); $table->longText('value'); $table->timestamps(); @@ -37,6 +37,6 @@ public function up() */ public function down() { - Schema::dropIfExists($this->config('database.settings_table')); + Schema::dropIfExists($this->config('database.settings_table') ?: 'admin_settings'); } } diff --git a/database/migrations/2020_09_22_015815_create_admin_extensions_table.php b/database/migrations/2020_09_22_015815_create_admin_extensions_table.php index 2320010f9..830bf4bad 100644 --- a/database/migrations/2020_09_22_015815_create_admin_extensions_table.php +++ b/database/migrations/2020_09_22_015815_create_admin_extensions_table.php @@ -23,7 +23,7 @@ public function config($key) */ public function up() { - Schema::create($this->config('database.extensions_table'), function (Blueprint $table) { + Schema::create($this->config('database.extensions_table') ?: 'admin_extensions', function (Blueprint $table) { $table->increments('id')->unsigned(); $table->string('name', 100)->unique(); $table->string('version', 20)->default(''); @@ -34,7 +34,7 @@ public function up() $table->engine = 'InnoDB'; }); - Schema::create($this->config('database.extension_histories_table'), function (Blueprint $table) { + Schema::create($this->config('database.extension_histories_table') ?: 'admin_extension_histories', function (Blueprint $table) { $table->bigIncrements('id')->unsigned(); $table->string('name', 100); $table->tinyInteger('type')->default(1); @@ -55,7 +55,7 @@ public function up() */ public function down() { - Schema::dropIfExists($this->config('database.extensions_table')); - Schema::dropIfExists($this->config('database.extension_histories_table')); + Schema::dropIfExists($this->config('database.extensions_table') ?: 'admin_extensions'); + Schema::dropIfExists($this->config('database.extension_histories_table') ?: 'admin_extension_histories'); } } diff --git a/src/Models/Extension.php b/src/Models/Extension.php index 46253170c..12003b532 100644 --- a/src/Models/Extension.php +++ b/src/Models/Extension.php @@ -18,7 +18,7 @@ public function __construct(array $attributes = []) $this->setConnection($connection); - $this->setTable(config('admin.database.extensions_table')); + $this->setTable(config('admin.database.extensions_table') ?: 'admin_extensions'); parent::__construct($attributes); } diff --git a/src/Models/ExtensionHistory.php b/src/Models/ExtensionHistory.php index c0ab0841d..a23ee44ff 100644 --- a/src/Models/ExtensionHistory.php +++ b/src/Models/ExtensionHistory.php @@ -14,7 +14,7 @@ public function __construct(array $attributes = []) $this->setConnection($connection); - $this->setTable(config('admin.database.extension_histories_table')); + $this->setTable(config('admin.database.extension_histories_table') ?: 'admin_extension_histories'); parent::__construct($attributes); } diff --git a/src/Models/Setting.php b/src/Models/Setting.php index 53253cee5..2d5816ff3 100644 --- a/src/Models/Setting.php +++ b/src/Models/Setting.php @@ -16,7 +16,7 @@ public function __construct(array $attributes = []) $this->setConnection($connection); - $this->setTable(config('admin.database.settings_table')); + $this->setTable(config('admin.database.settings_table') ?: 'admin_settings'); parent::__construct($attributes); }