Skip to content

Commit f91233f

Browse files
Merge pull request #59 from IrsyadProject/feature-kodewilayahindonesia
Update CSV data kode wilayah dari KEMENDAGRI Tahun 2023, update migration & seeder kode wilayah
2 parents 66d4f1d + fa4bafa commit f91233f

File tree

4 files changed

+91612
-91229
lines changed

4 files changed

+91612
-91229
lines changed

database/migrations/create_kode_wilayah_indonesia_table.php.stub

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,20 @@ use Illuminate\Support\Facades\Schema;
77
class CreateKodeWilayahIndonesiaTable extends Migration
88
{
99
/**
10-
* Reverse the migrations.
10+
* Run the migrations.
1111
*
1212
* @return void
1313
*/
1414
public function up()
1515
{
1616
Schema::connection(config('satusehatintegration.database_connection_master'))->create(config('satusehatintegration.kode_wilayah_indonesia_table_name'), function (Blueprint $table) {
1717
$table->bigIncrements('id');
18-
$table->string('kode_wilayah');
19-
$table->longText('nama_wilayah');
20-
$table->boolean('active')->default(true);
18+
// Level wilayah (1: Provinsi, 2: Kabupaten, 3: Kecamatan, 4: Desa/Kelurahan)
19+
$table->integer('level');
20+
$table->string('kode_wilayah', 20); // Kode wilayah unik
21+
$table->string('nama_wilayah'); // Nama wilayah
22+
$table->string('parent')->nullable(); // Parent wilayah (kode - nama wilayah)
23+
$table->string('state')->nullable(); // State atau negara bagian
2124
$table->timestamps();
2225
});
2326
}

database/seeders/KodeWilayahIndonesiaSeeder.php.stub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class KodeWilayahIndonesiaSeeder extends CsvSeeder
1414
public function __construct(){
1515
$this->file = base_path().'/database/seeders/csv/kode_wilayah_indonesia.csv';
1616
$this->tablename = config('satusehatintegration.kode_wilayah_indonesia_table_name');
17-
$this->delimiter = ',';
17+
$this->delimiter = ';';
1818
}
1919

2020
public function run()

0 commit comments

Comments
 (0)