Explorar o código

快递信息同步

ANG YU %!s(int64=4) %!d(string=hai) anos
pai
achega
7d8028326a

+ 42 - 0
database/migrations/2021_09_11_163234_add_index_created_at_to_order_packages_table.php

@@ -0,0 +1,42 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class AddIndexCreatedAtToOrderPackagesTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('order_packages', function (Blueprint $table) {
+            $table->dropIndex('order_packages_express_index');
+        });
+
+        Schema::table('order_packages', function (Blueprint $table) {
+            $table->index(['created_at', 'order_id', 'status', 'exception_status', 'received_at', 'sync_routes_flag'], 'order_packages_express_index');
+
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('order_packages', function (Blueprint $table) {
+            $table->dropIndex('order_packages_express_index');
+
+        });
+
+        Schema::table('order_packages', function (Blueprint $table) {
+            $table->index(['sent_at', 'order_id', 'status', 'exception_status','received_at', 'sync_routes_flag'], 'order_packages_express_index');
+        });
+    }
+}