Laravel Vapor - New index for packages table

This commit is contained in:
Dillon Ngo
2024-09-12 22:36:03 +08:00
parent b01159e47a
commit 2e871cd42f
@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddIndexToPackagesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('packages', function (Blueprint $table) {
$table->index(['packing_list_id', 'deleted_at'], 'idx_packing_list_id_deleted_at_on_packages');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('packages', function (Blueprint $table) {
$table->dropIndex('idx_packing_list_id_deleted_at_on_packages');
});
}
}