43 lines
1.5 KiB
PHP
43 lines
1.5 KiB
PHP
<?php
|
||
|
||
use Illuminate\Database\Migrations\Migration;
|
||
use Illuminate\Database\Schema\Blueprint;
|
||
use Illuminate\Support\Facades\Schema;
|
||
|
||
class CreateArticlesTable extends Migration
|
||
{
|
||
/**
|
||
* Run the migrations.
|
||
*
|
||
* @return void
|
||
*/
|
||
public function up()
|
||
{
|
||
Schema::create('articles', function (Blueprint $table) {
|
||
$table->id();
|
||
$table->bigInteger('category_id')->default(0)->comment('分类ID');
|
||
$table->string('title')->comment('文章标题');
|
||
$table->string('author_name')->nullable()->comment('作者名称');
|
||
$table->string('subtitle')->nullable()->comment('副标题');
|
||
$table->string('cover')->nullable()->comment('文章封面图');
|
||
$table->text('content')->nullable()->comment('文章内容');
|
||
$table->tinyInteger('jump_type')->default(0)->comment('跳转类型:0不跳转,1跳转应用内页,2H5链接');
|
||
$table->string('jump_link')->nullable()->comment('跳转地址');
|
||
$table->tinyInteger('is_show')->default(0)->comment('是否显示:0不显示,1显示');
|
||
$table->tinyInteger('is_recommend')->default(0)->comment('是否推荐:0不推荐,1推荐');
|
||
$table->integer('sort')->default(0)->comment('排序');
|
||
$table->timestamps();
|
||
});
|
||
}
|
||
|
||
/**
|
||
* Reverse the migrations.
|
||
*
|
||
* @return void
|
||
*/
|
||
public function down()
|
||
{
|
||
Schema::dropIfExists('articles');
|
||
}
|
||
}
|