solve comflict

This commit is contained in:
BTMS1
2023-11-15 12:57:41 +08:00
12 changed files with 551 additions and 72 deletions
@@ -0,0 +1,70 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
class AddOnepercentToGadaiTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
/**
*
* @var object $db_connection
*/
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()
{
$db_connection = $this->getActiveDB();
foreach($db_connection as $dbase){
Schema::connection($dbase)->table('gadai', function (Blueprint $table) {
$table->decimal('kadarujrah', 5, 2);
$table->decimal('ujrah', 9, 2);
$table->decimal('onepercent', 9, 2);
$table->decimal('margin_semasa', 5, 2);
$table->tinyInteger('tagbaru')->default(0);
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
$db_connection = $this->getActiveDB();
foreach($db_connection as $dbase){
Schema::connection($dbase)->table('gadai', function (Blueprint $table) {
$table->dropColumn(['kadarujrah', 'ujrah', 'onepercent','margin_semasa','tagbaru']);
});
}
}
}
@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateHistoryOnepercentTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('history_onepercent', function (Blueprint $table) {
$table->id();
$table->decimal('tempoh', 10, 2);
$table->decimal('ujrah', 10, 2);
$table->decimal('onepercent', 10, 2);
$table->decimal('margin_semasa', 5, 2);
$table->decimal('bakipinjaman', 10, 2);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('history_onepercent');
}
}
@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddOnepercentToKadarupahTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection('mysql7')->table('kadarupah', function (Blueprint $table) {
$table->decimal('kadarujrah', 5, 2);
$table->decimal('kadaronepercent', 5, 2);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection('mysql7')->table('kadarupah', function (Blueprint $table) {
$table->dropColumn(['kadarujrah','kadaronepercent']);
});
}
}
@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddOnepercentToTransactionKeuntunganTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection('mysql7')->table('transaksi_keuntungan', function (Blueprint $table) {
$table->decimal('ujrah', 5, 2);
$table->decimal('ujrah_rebet', 5, 2);
$table->decimal('onepercent', 5, 2);
$table->decimal('onepercent_rebet', 5, 2);
$table->decimal('tempoh', 5, 2);
$table->decimal('beza_tempoh', 5, 2);
$table->decimal('margin_semasa', 5, 2);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection('mysql7')->table('transaksi_keuntungan', function (Blueprint $table) {
$table->dropColumn(['ujrah', 'ujrah_rebet', 'onepercent', 'onepercent_rebet', 'tempoh', 'beza_tempoh', 'margin_semasa']);
});
}
}
@@ -0,0 +1,65 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
class AddOnepercentToTebusTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
/**
*
* @var object $db_connection
*/
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()
{
$db_connection = $this->getActiveDB();
foreach($db_connection as $dbase){
Schema::connection($dbase)->table('tebus', function (Blueprint $table) {
$table->decimal('ujrah', 9, 2);
$table->decimal('onepercent', 9, 2);
});
};
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
$db_connection = $this->getActiveDB();
foreach($db_connection as $dbase){
Schema::connection($dbase)->table('tebus', function (Blueprint $table) {
$table->dropColumn(['ujrah', 'onepercent']);
});
}
}
}