2021_01_16_132340_create_histories_table.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateHistoriesTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('histories', function (Blueprint $table) {
  15. $table->id();
  16. $table->bigInteger('to_province')->default(0)->comment('省份');
  17. $table->bigInteger('to_city')->default(0)->comment('市');
  18. $table->bigInteger('to_area')->default(0)->comment('县/区');
  19. $table->bigInteger('to_street')->default(0)->comment('乡级');
  20. $table->bigInteger('from_province')->default(0)->comment('省份');
  21. $table->bigInteger('from_city')->default(0)->comment('市');
  22. $table->bigInteger('from_area')->default(0)->comment('县/区');
  23. $table->bigInteger('from_street')->default(0)->comment('乡级');
  24. $table->string('to_name', 300)->nullable()->comment('目的地');
  25. $table->string('from_name', 300)->nullable()->comment('出发地');
  26. $table->bigInteger('user_id')->default(0);
  27. $table->timestamps();
  28. });
  29. }
  30. /**
  31. * Reverse the migrations.
  32. *
  33. * @return void
  34. */
  35. public function down()
  36. {
  37. Schema::dropIfExists('histories');
  38. }
  39. }