fix(cities): perbaiki pemetaan kolom untuk tabel kota
- Menambahkan indeks pada kolom 'code' untuk meningkatkan performa pencarian. - Menghapus indeks yang tidak diperlukan untuk kolom 'province_code'.
This commit is contained in:
@@ -14,17 +14,13 @@ return new class extends Migration
|
||||
Schema::create('cities', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('province_code')->index();
|
||||
$table->string('code');
|
||||
$table->string('code')->index();
|
||||
$table->string('name');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->uuid('created_by')->nullable();
|
||||
$table->uuid('updated_by')->nullable();
|
||||
$table->uuid('deleted_by')->nullable();
|
||||
|
||||
$table->index('code');
|
||||
$table->index('province_code');
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -15,17 +15,13 @@ return new class extends Migration
|
||||
$table->id();
|
||||
$table->string('province_code')->index();
|
||||
$table->string('city_code')->index();
|
||||
$table->string('code');
|
||||
$table->string('code')->index();
|
||||
$table->string('name');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->uuid('created_by')->nullable();
|
||||
$table->uuid('updated_by')->nullable();
|
||||
$table->uuid('deleted_by')->nullable();
|
||||
|
||||
$table->index('code');
|
||||
$table->index('province_code');
|
||||
$table->index('city_code');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ return new class extends Migration
|
||||
$table->string('province_code')->index();
|
||||
$table->string('city_code')->index();
|
||||
$table->string('district_code')->index();
|
||||
$table->string('code');
|
||||
$table->string('code')->index();
|
||||
$table->string('name');
|
||||
$table->string('alt_name')->nullable();
|
||||
$table->string('postal_code', 5)->nullable();
|
||||
@@ -25,11 +25,6 @@ return new class extends Migration
|
||||
$table->uuid('created_by')->nullable();
|
||||
$table->uuid('updated_by')->nullable();
|
||||
$table->uuid('deleted_by')->nullable();
|
||||
|
||||
$table->index('code');
|
||||
$table->index('province_code');
|
||||
$table->index('city_code');
|
||||
$table->index('district_code');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user