2020_08_21_145711_create_article_table.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateArticleTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('article', function (Blueprint $table) {
  15. $table->increments('id');
  16. $table->boolean('type')->default(1)->comment('类型:1-文章、2-站内公告、3-站外公告');
  17. $table->string('title', 100)->comment('标题');
  18. $table->string('summary')->nullable()->comment('简介');
  19. $table->string('logo')->nullable()->comment('LOGO');
  20. $table->text('content')->nullable()->comment('内容');
  21. $table->unsignedTinyInteger('sort')->default(0)->comment('排序');
  22. $table->dateTime('created_at')->comment('创建时间');
  23. $table->dateTime('updated_at')->comment('最后更新时间');
  24. $table->softDeletes()->comment('删除时间');
  25. });
  26. }
  27. /**
  28. * Reverse the migrations.
  29. *
  30. * @return void
  31. */
  32. public function down()
  33. {
  34. Schema::dropIfExists('article');
  35. }
  36. }