提交代码
This commit is contained in:
42
vendor/laravel-admin-ext/config/database/migrations/2017_07_17_040159_create_config_table.php
vendored
Normal file
42
vendor/laravel-admin-ext/config/database/migrations/2017_07_17_040159_create_config_table.php
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateConfigTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$connection = config('admin.database.connection') ?: config('database.default');
|
||||
|
||||
$table = config('admin.extensions.config.table', 'admin_config');
|
||||
|
||||
Schema::connection($connection)->create($table, function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name')->unique();
|
||||
$table->string('value');
|
||||
$table->text('description')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$connection = config('admin.database.connection') ?: config('database.default');
|
||||
|
||||
$table = config('admin.extensions.config.table', 'admin_config');
|
||||
|
||||
Schema::connection($connection)->dropIfExists($table);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user