Merged in bugfix/fix-job (pull request #246)

fix kerja
This commit is contained in:
Ain Izazi Aziz
2025-01-02 04:21:48 +00:00
committed by Muhd hafifie
5 changed files with 65 additions and 4 deletions
@@ -0,0 +1,50 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddNotaPekerjaan extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function getActiveDB(){
$config_db = array_keys(config("database.connections"));
$db_connection = array_filter($config_db,function($connection){
try{
if($connection == 'mysql7')
return false;
$db = DB::connection($connection)->getPdo();
return true;
} catch(\Exception $e){
return false;
}
});
return $db_connection;
}
public function up()
{
Schema::connection('mysql7')->table('customer', function (Blueprint $table) {
$table->string('nota_pekerjaan')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('customer', function (Blueprint $table) {
$table->dropColumn('nota_pekerjaan');
});
}
}