Skip to content

Commit

Permalink
Merge pull request #59 from IrsyadProject/feature-kodewilayahindonesia
Browse files Browse the repository at this point in the history
Update CSV data kode wilayah dari KEMENDAGRI Tahun 2023, update migration & seeder kode wilayah
  • Loading branch information
ivanwilliammd authored Nov 4, 2024
2 parents 66d4f1d + fa4bafa commit f91233f
Show file tree
Hide file tree
Showing 4 changed files with 91,612 additions and 91,229 deletions.
11 changes: 7 additions & 4 deletions database/migrations/create_kode_wilayah_indonesia_table.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@ use Illuminate\Support\Facades\Schema;
class CreateKodeWilayahIndonesiaTable extends Migration
{
/**
* Reverse the migrations.
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection(config('satusehatintegration.database_connection_master'))->create(config('satusehatintegration.kode_wilayah_indonesia_table_name'), function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('kode_wilayah');
$table->longText('nama_wilayah');
$table->boolean('active')->default(true);
// Level wilayah (1: Provinsi, 2: Kabupaten, 3: Kecamatan, 4: Desa/Kelurahan)
$table->integer('level');
$table->string('kode_wilayah', 20); // Kode wilayah unik
$table->string('nama_wilayah'); // Nama wilayah
$table->string('parent')->nullable(); // Parent wilayah (kode - nama wilayah)
$table->string('state')->nullable(); // State atau negara bagian
$table->timestamps();
});
}
Expand Down
2 changes: 1 addition & 1 deletion database/seeders/KodeWilayahIndonesiaSeeder.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class KodeWilayahIndonesiaSeeder extends CsvSeeder
public function __construct(){
$this->file = base_path().'/database/seeders/csv/kode_wilayah_indonesia.csv';
$this->tablename = config('satusehatintegration.kode_wilayah_indonesia_table_name');
$this->delimiter = ',';
$this->delimiter = ';';
}

public function run()
Expand Down
Loading

0 comments on commit f91233f

Please sign in to comment.