2024_11_14_024847_create_member_addresses_table.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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('member_addresses', function (Blueprint $table) {
  15. $table->comment('用户地址管理');
  16. $table->increments('id');
  17. $table->unsignedBigInteger('user_id')->comment('用户编号');
  18. $table->string('location')->default('')->comment('定位地址');
  19. $table->string('detail')->nullable()->comment('详细地址');
  20. $table->string('province')->default('')->comment('省');
  21. $table->string('city')->default('')->comment('市');
  22. $table->string('district')->default('')->comment('区');
  23. $table->decimal('longitude')->comment('经度');
  24. $table->decimal('latitude')->comment('纬度');
  25. $table->string('area_code')->default('')->comment('行政区划代码');
  26. $table->string('is_default')->default('NO')->comment('是否默认地址');
  27. $table->timestamps();
  28. $table->softDeletes();
  29. });
  30. }
  31. /**
  32. * Reverse the migrations.
  33. *
  34. * @return void
  35. */
  36. public function down()
  37. {
  38. Schema::dropIfExists('member_addresses');
  39. }
  40. };