2019_08_05_171534_create_bikes_table.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateBikesTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('bikes', function (Blueprint $table) {
  15. $table->bigIncrements('id');
  16. $table->string('bike_no', 30)->comment('车辆编号');
  17. $table->string('box_no', 30)->nullable()->comment('控制设备编号');
  18. $table->string('blu_key', 32)->nullable()->comment('蓝牙key');
  19. $table->tinyInteger('battery_power')->default(0)->comment('电量');
  20. $table->tinyInteger('is_link')->default(0)->comment('是否在线');
  21. $table->tinyInteger('is_lock')->default(0)->comment('是否锁车');
  22. $table->tinyInteger('is_low_battery_power')->default(0)->comment('是否电量低');
  23. $table->tinyInteger('is_riding')->default(0)->comment('是否骑行');
  24. $table->tinyInteger('is_trouble')->default(0)->comment('是否故障');
  25. $table->timestamp('last_use_bike_end_time')->nullable()->comment('最后骑行时间');
  26. $table->string('last_location')->nullable()->comment('最后位置信息');
  27. $table->timestamp('last_location_time')->nullable()->comment('最后定位时间');
  28. $table->bigInteger('put_area_id')->default(0)->comment('投放区域id');
  29. $table->tinyInteger('put_status')->default(0)->comment('投放状态');
  30. $table->timestamp('put_time')->nullable()->comment('投放时间');
  31. $table->string('blu_ase_key', 100)->nullable()->comment('蓝牙key+box_no = 秘钥');
  32. $table->tinyInteger('status')->default(1);
  33. $table->timestamps();
  34. });
  35. }
  36. /**
  37. * Reverse the migrations.
  38. *
  39. * @return void
  40. */
  41. public function down()
  42. {
  43. Schema::dropIfExists('bikes');
  44. }
  45. }