2020_02_10_103905_change_package_column.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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('logistic_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()->comment('长(cm)');
  28. $table->decimal('width')->nullable()->comment('宽(cm)');
  29. $table->decimal('height')->nullable()->comment('高(cm)');
  30. $table->decimal('bulk')->nullable()->comment('体积(cm³)');
  31. $table->bigInteger('paper_box_id')->nullable()->index()->comment('外键纸箱');
  32. $table->dateTime('weighed_at')->nullable()->comment('称重时间');
  33. $table->enum('status',['无','未上传','已上传','未测量','未下发','上传异常','下发异常','记录异常','已上传异常','测量异常'])->default('无')->comment('包裹信息状态');
  34. $table->timestamps();
  35. });
  36. }
  37. /**
  38. * Reverse the migrations.
  39. *
  40. * @return void
  41. */
  42. public function down()
  43. {
  44. Schema::dropIfExists('packages');
  45. }
  46. }