2019_12_30_171202_create_packages_table.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreatePackagesTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('packages', function (Blueprint $table) {
  15. $table->bigIncrements('id');
  16. $table->string('logistic_number')->unique()->comment('快递单号');
  17. $table->enum('type',['普通波次','活动波次'])->default('普通波次')->index()->comment('波次类型');
  18. $table->decimal('weight')->comment('重KG');
  19. $table->decimal('length')->index()->comment('长(cm)');
  20. $table->decimal('width')->index()->comment('宽(cm)');
  21. $table->decimal('height')->index()->comment('高(cm)');
  22. $table->bigInteger('owner_id')->index()->comment('外键货主');
  23. $table->bigInteger('paper_box_id')->index()->comment('外键纸箱');
  24. $table->bigInteger('measuring_machine_id')->index()->comment('外键设备');
  25. $table->string('recipient')->comment('收件人');
  26. $table->enum('status',['无','未上传','已上传','异常'])->default('无')->comment('包裹信息状态');
  27. $table->timestamps();
  28. });
  29. }
  30. /**
  31. * Reverse the migrations.
  32. *
  33. * @return void
  34. */
  35. public function down()
  36. {
  37. Schema::dropIfExists('packages');
  38. }
  39. }