add column group id to kadarupah & cawangan
This commit is contained in:
committed by
Hafifie PKB
parent
6423dde600
commit
214d4f0e49
@@ -42,7 +42,7 @@ class AddColumnsToKomuditiTransaksi extends Migration
|
|||||||
{
|
{
|
||||||
$online_arrahn_connection_array = array_filter(config('database.connections'), function($connection) {
|
$online_arrahn_connection_array = array_filter(config('database.connections'), function($connection) {
|
||||||
|
|
||||||
if($connection['database'] === 'online_arrahn'){
|
if($connection['database'] === 'online_arrahn' || $connection['database'] === 'master_krk'){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ class AddColumnsToKomuditiTransaksi extends Migration
|
|||||||
|
|
||||||
|
|
||||||
if(empty($online_arrahn_connection_array)){
|
if(empty($online_arrahn_connection_array)){
|
||||||
throw new Exception("online_arrahn doesn't exist in config.database.connections array");
|
throw new Exception("online_arrahn or master_krk doesn't exist in config.database.connections array");
|
||||||
}
|
}
|
||||||
|
|
||||||
return array_keys($online_arrahn_connection_array)[0];
|
return array_keys($online_arrahn_connection_array)[0];
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class AddGroupIdToKadarupahTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('kadarupah', function (Blueprint $table) {
|
||||||
|
//
|
||||||
|
$table->integer('group_id');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::connection('mysql7')->table('kadarupah', function (Blueprint $table) {
|
||||||
|
$table->dropColumn(['group_id']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class AddGroupIdToArrahnMasterDbTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('arrahn_master_db', function (Blueprint $table) {
|
||||||
|
//
|
||||||
|
$table->integer('group_id');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::connection('mysql7')->table('arrahn_master_db', function (Blueprint $table) {
|
||||||
|
$table->dropColumn(['group_id']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user