2021_11_03_174248_create_system_configs_table.php 1.3 KB
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSystemConfigsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('system_configs', function (Blueprint $table) {
            $table->increments('id');
            $table->string("key", 20)->default('')->nullable()->comment('键');
            $table->text('value')->default('')->nullable()->comment('值');
            $table->string('type')->default('')->nullable()->comment('值类型');
            $table->string('name', 100)->default('')->nullable()->comment('名称');
            $table->string('description')->default('')->nullable()->comment('说明');
            $table->unsignedInteger('sort')->default(1)->comment('排序');
            $table->unsignedTinyInteger('status')->default(1)->comment('状态:1可用;0冻结');

            $table->softDeletes();
            $table->timestamps();
        });

        DB::statement("ALTER TABLE system_configs comment '系统-配置表' ");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('system_configs');
    }
}