2019_01_24_064338_create_articles_table.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateArticlesTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('articles', function (Blueprint $table) {
  15. $table->increments('id');
  16. $table->string("name")->comment("文章标题");
  17. $table->string('picture')->comment("文章封面");
  18. $table->text('content')->comment('文章内容');
  19. $table->integer('articletype_id')->comment('文章类型');
  20. $table->string('source')->comment('文章来源');
  21. $table->string('author')->comment('作者');
  22. $table->boolean('ispush')->comment('是否发布');
  23. $table->timestamps();
  24. });
  25. }
  26. /**
  27. * Reverse the migrations.
  28. *
  29. * @return void
  30. */
  31. public function down()
  32. {
  33. Schema::dropIfExists('articles');
  34. }
  35. }