6
0
Fork 0
jiqu-library-server/database/migrations/2021_11_19_143916_create_ar...

43 lines
1.5 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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