2018_06_29_231340_create_contents_table.php 936 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateContentsTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('contents', function (Blueprint $table) {
  15. $table->increments('id');
  16. $table->tinyInteger('type')->nullable()->comment('类型:1公告;2活动;3视频;4文章');
  17. $table->string('title', 200)->nullable()->comment('标题');
  18. $table->text('content')->nullable()->comment('内容');
  19. $table->unsignedInteger('sort')->nullable()->default(0)->comment('排序');
  20. $table->timestamps();
  21. });
  22. }
  23. /**
  24. * Reverse the migrations.
  25. *
  26. * @return void
  27. */
  28. public function down()
  29. {
  30. Schema::dropIfExists('contents');
  31. }
  32. }