2020_05_18_105150_change_cities_table.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class ChangeCitiesTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. //行政区划 一级省 二级市 三级县区 四级乡
  15. Schema::table('cities', function (Blueprint $table) {
  16. $table->bigInteger('type')->default(2)->comment('行政级别');
  17. });
  18. Schema::table('w_m_s_waybills', function (Blueprint $table) {
  19. $table->string('ReservedField01')->nullable()->comment('预留字段1');
  20. });
  21. Schema::table('waybills', function (Blueprint $table) {
  22. $table->string('source_bill')->after('waybill_number')->nullable()->comment('上游单号');
  23. });
  24. }
  25. /**
  26. * Reverse the migrations.
  27. *
  28. * @return void
  29. */
  30. public function down()
  31. {
  32. Schema::table('cities', function (Blueprint $table) {
  33. $table->dropColumn('type');
  34. });
  35. Schema::table('w_m_s_waybills', function (Blueprint $table) {
  36. $table->dropColumn('ReservedField01');
  37. });
  38. Schema::table('waybills', function (Blueprint $table) {
  39. $table->dropColumn('source_bill');
  40. });
  41. }
  42. }