2020_02_10_103905_change_package_column.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class ChangePackageColumn extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::dropIfExists('packages');
  15. Schema::create('packages', function (Blueprint $table) {
  16. $table->bigIncrements('id');
  17. $table->bigInteger('owner_id')->nullable()->index()->comment('外键货主');
  18. $table->string('logistic_number')->unique()->comment('快递单号');
  19. $table->string('delivery_number')->nullable()->unique()->comment('发货单号');
  20. $table->string('batch_number')->nullable()->index()->comment('波次号');
  21. $table->string('batch_rule')->nullable()->comment('波次规则');
  22. $table->string('recipient')->nullable()->comment('收件人');
  23. $table->string('recipient_mobile')->nullable()->comment('收件人电话');
  24. $table->bigInteger('logistics_id')->nullable()->index()->comment('外键物流公司');
  25. $table->bigInteger('measuring_machine_id')->nullable()->index()->comment('外键设备');
  26. $table->decimal('weight')->nullable()->comment('重KG');
  27. $table->decimal('length')->nullable()->index()->comment('长(cm)');
  28. $table->decimal('width')->nullable()->index()->comment('宽(cm)');
  29. $table->decimal('height')->nullable()->index()->comment('高(cm)');
  30. $table->decimal('bulk')->nullable()->comment('体积(cm³)');
  31. $table->bigInteger('paper_box_id')->nullable()->index()->comment('外键纸箱');
  32. $table->enum('status',['无','未上传','已上传','未测量','未下发','上传异常','下发异常','记录异常'])->default('无')->comment('包裹信息状态');
  33. $table->timestamps();
  34. });
  35. }
  36. /**
  37. * Reverse the migrations.
  38. *
  39. * @return void
  40. */
  41. public function down()
  42. {
  43. Schema::dropIfExists('packages');
  44. }
  45. }