feat(Basicdata): Update 'is_dalam_kota' column and add new branches

- Update 'is_dalam_kota' to true for existing branches based on suffix code
- Set 'is_dalam_kota' to false for branches not in the list
- Add new branches (ID0012005 - KORPORASI, ID0010172 - AMBON TUAL MALUKU)
- Seeder is idempotent and can be rerun safely

run this command:
php artisan module:seed Basicdata --class="UpdateBranchesIsDalamKotaSeeder"

php artisan module:seed --class="Modules\\Basicdata\\Database\\Seeders\\UpdateBranchesIsDalamKotaSeeder"
This commit is contained in:
Sholahuddin Al Ayubi
2025-12-08 17:19:12 +07:00
parent 4c4a4a33a9
commit fec8dc083c
4 changed files with 84 additions and 1 deletions

View File

@@ -0,0 +1,27 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('branches', function (Blueprint $table) {
$table->boolean('is_dalam_kota')->default(true)->after('name');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('branches', function (Blueprint $table) {
$table->dropColumn('is_dalam_kota');
});
}
};