2020_07_29_155624_create_orders_table.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateOrdersTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('orders', function (Blueprint $table) {
  15. $table->bigIncrements('id');
  16. $table->string("batch_id")->index()->nullable();
  17. $table->string("code")->index()->nullable();
  18. $table->integer("owner_id")->nullable();
  19. $table->enum("status",['处理中','未处理','已处理','取消','异常'])->default('未处理');
  20. $table->string("wms_status");
  21. $table->integer('shop_id')->index()->nullable()->comment('商铺');
  22. $table->integer("logistic_id")->index()->nullable()->comment('承运商');
  23. $table->string("consignee_name")->index()->nullable()->comment('收件人');
  24. $table->string("consignee_phone")->index()->nullable()->comment('收件人电话');
  25. $table->String("province")->nullable()->comment('省');
  26. $table->String("city")->nullable()->comment('市');
  27. $table->String("district")->nullable()->comment('区');
  28. $table->string("address")->nullable()->comment('地址');
  29. $table->timestamp('created_at')->index();
  30. $table->timestamp('updated_at')->index();
  31. // $table->string("logistic_number")->index()->nullable()->comment('承运单号');
  32. // $table->timestamps();
  33. });
  34. }
  35. /**
  36. * Reverse the migrations.
  37. *
  38. * @return void
  39. */
  40. public function down()
  41. {
  42. Schema::dropIfExists('orders');
  43. }
  44. }