2021_12_29_045353_create_author_table.php
894 Bytes
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateAuthorTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('author', function (Blueprint $table) {
$table->increments('id');
$table->string('name')->index()->default('')->comment('姓名');
$table->string('dynasty')->index()->default('')->comment('朝代');
$table->text('introduce')->comment('介绍');
$table->unsignedTinyInteger('state')->index()->default(0)->comment('状态');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('author');
}
}