2019_08_05_171552_create_location_logs_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 CreateLocationLogsTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('location_logs', function (Blueprint $table) {
  15. $table->bigIncrements('id');
  16. $table->string('bike_no', 50)->comment('车辆编号');
  17. $table->string('box_no', 50)->comment('控制设备编号');
  18. $table->bigInteger('bike_id')->default(0)->comment('车id');
  19. $table->bigInteger('area_id')->default(0)->comment('区域id');
  20. $table->float('latitude', 10, 7)->default(0.00)->comment('维度');
  21. $table->float('longitude', 10, 7)->default(0.00)->comment('经度');
  22. $table->tinyInteger('battery_power')->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('location_logs');
  35. }
  36. }