add column group id to kadarupah & cawangan
This commit is contained in:
@@ -42,7 +42,7 @@ class AddColumnsToKomuditiTransaksi extends Migration
|
||||
{
|
||||
$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;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ class AddColumnsToKomuditiTransaksi extends Migration
|
||||
|
||||
|
||||
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];
|
||||
|
||||
@@ -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