2024_11_14_060429_create_coach_locations_table.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. return new class extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('coach_locations', function (Blueprint $table) {
  15. $table->comment('技师定位');
  16. $table->increments('id');
  17. $table->unsignedBigInteger('coach_id')->comment('技师编号');
  18. $table->string('type')->default('CURRENT')->comment('地址类型');
  19. $table->decimal('latitude')->comment('纬度');
  20. $table->decimal('longitude')->comment('经度');
  21. $table->string('province')->default('')->comment('省');
  22. $table->string('city')->default('')->comment('市');
  23. $table->string('district')->default('')->comment('区');
  24. $table->string('location')->default('')->comment('定位地址');
  25. $table->string('area_code')->default('')->comment('行政区划代码');
  26. $table->timestamps();
  27. $table->softDeletes();
  28. });
  29. }
  30. /**
  31. * Reverse the migrations.
  32. *
  33. * @return void
  34. */
  35. public function down()
  36. {
  37. Schema::dropIfExists('coach_locations');
  38. }
  39. };