1
0
Files
lkafu/database/migrations/2019_11_05_111227_create_articles_table.php
2020-08-06 14:45:56 +08:00

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');
}
}