2019_05_08_160636_create_articles_table.php 876 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. class CreateArticlesTable extends Migration {
  5. /**
  6. * Run the migrations.
  7. *
  8. * @return void
  9. */
  10. public function up()
  11. {
  12. Schema::create('articles', function(Blueprint $table)
  13. {
  14. $table->increments('id');
  15. $table->integer('category_id')->comment('分类id');
  16. $table->string('title', 200)->comment('标题');
  17. $table->string('keywords', 200)->comment('关键词');
  18. $table->text('description', 65535)->comment('描述');
  19. $table->text('content', 65535)->comment('内容');
  20. $table->integer('click')->default(0)->comment('点击量');
  21. $table->string('thumb', 200)->nullable()->comment('缩略图');
  22. $table->timestamps();
  23. });
  24. }
  25. /**
  26. * Reverse the migrations.
  27. *
  28. * @return void
  29. */
  30. public function down()
  31. {
  32. Schema::drop('articles');
  33. }
  34. }