Skip to content

Commit

Permalink
默认表格
Browse files Browse the repository at this point in the history
  • Loading branch information
jqhph committed Nov 16, 2020
1 parent af28b17 commit fc85371
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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('');
Expand All @@ -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);
Expand All @@ -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');
}
}
2 changes: 1 addition & 1 deletion src/Models/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Models/ExtensionHistory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit fc85371

Please sign in to comment.