|
|
@@ -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');
|
|
|
+ });
|
|
|
+ }
|
|
|
+}
|