2020_07_13_083216_create_mentality_drills_table.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateMentalityDrillsTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('mentality_drills', function (Blueprint $table) {
  15. $table->id();
  16. $table->bigInteger('category_id')->comment('分类id')->index();
  17. $table->string('title')->comment('标题');
  18. $table->string('subtitle')->nullable()->comment('副标题');
  19. $table->string('pic')->comment('图片');
  20. $table->longText('content')->comment('内容');
  21. $table->integer('number_of_studies')->default(0)->comment('学习次数')->index();
  22. $table->bigInteger('rank')->default(0)->comment('排序 越大越前')->index();
  23. $table->timestamps();
  24. $table->softDeletes();
  25. });
  26. }
  27. /**
  28. * Reverse the migrations.
  29. *
  30. * @return void
  31. */
  32. public function down()
  33. {
  34. Schema::dropIfExists('mentality_drills');
  35. }
  36. }