2018_10_08_100301_create_articles_table.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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->integer('type_id')->comment('新闻分类');
  17. $table->integer('parent_id')->comment('新闻分类父id');
  18. $table->string('title')->comment('新闻标题');
  19. $table->mediumText('content')->comment('新闻内容')->nullable();
  20. $table->string('tit_color')->default('#000000')->comment('新闻标题颜色');
  21. $table->tinyInteger('tit_b')->comment('新闻标题是否加粗(1:加粗,0:不加粗)');
  22. $table->string('small_img')->comment('新闻缩略图')->nullable();
  23. $table->tinyInteger('is_display')->default('1')->comment('是否显示(1:显示,0:不显示)');
  24. $table->string('released_at')->comment('新闻发布日期');
  25. $table->integer('list_order')->comment('排序');
  26. $table->string('author')->comment('作者');
  27. $table->string('source')->comment('新闻来源');
  28. $table->integer('property_id')->comment('新闻属性');
  29. $table->string('is_url')->comment('外部链接');
  30. $table->string('seo_keywords')->comment('Seo优化关键字');
  31. $table->string('seo_description')->comment('Seo优化描述');
  32. $table->integer('click')->comment('点击量');
  33. $table->tinyInteger('robot')->comment('0:人工,1:采集');
  34. $table->integer('subsite_id')->default('0')->comment('分站id(0:总站)');
  35. $table->timestamps();
  36. $table->softDeletes();
  37. });
  38. }
  39. /**
  40. * Reverse the migrations.
  41. *
  42. * @return void
  43. */
  44. public function down()
  45. {
  46. Schema::dropIfExists('articles');
  47. }
  48. }