2019_08_26_181809_create_trouble_table.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateTroubleTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('troubles', function (Blueprint $table) {
  15. $table->bigIncrements('id');
  16. $table->bigInteger('user_id')->default(0)->comment('用户id');
  17. $table->bigInteger('bike_id')->default(0)->comment('车id');
  18. $table->bigInteger('area_id')->default(0)->comment('区域id');
  19. $table->string('trouble_part', 30)->nullable()->comment('故障部位');
  20. $table->string('trouble_imgs')->nullable()->comment('故障图片');
  21. $table->text('trouble_description')->nullable()->comment('故障描述');
  22. $table->tinyInteger('up_trouble_type')->default(0)->comment('问题类型');
  23. $table->tinyInteger('status')->default(1);
  24. $table->timestamps();
  25. });
  26. }
  27. /**
  28. * Reverse the migrations.
  29. *
  30. * @return void
  31. */
  32. public function down()
  33. {
  34. Schema::dropIfExists('troubles');
  35. }
  36. }