2020_07_29_155624_create_orders_table.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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->integer("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. });
  32. }
  33. /**
  34. * Reverse the migrations.
  35. *
  36. * @return void
  37. */
  38. public function down()
  39. {
  40. Schema::dropIfExists('orders');
  41. }
  42. }