42 lines
845 B
PHP
42 lines
845 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
class CreateArticlesTable extends Migration {
|
|
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('articles', function(Blueprint $table)
|
|
{
|
|
$table->bigInteger('id', true)->unsigned();
|
|
$table->string('title');
|
|
$table->integer('category_id')->comment('分类id');
|
|
$table->string('description')->nullable();
|
|
$table->string('cover')->nullable();
|
|
$table->text('content');
|
|
$table->boolean('status')->default(0);
|
|
$table->integer('order')->unsigned()->default(0);
|
|
$table->integer('clicks')->unsigned()->nullable()->default(0);
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::drop('articles');
|
|
}
|
|
|
|
}
|