added failover transaction to seize the error from transactions.

This commit is contained in:
hafifierahman
2024-11-18 00:29:27 +08:00
parent 72a8d3228c
commit 5d18764a34
3 changed files with 144 additions and 10 deletions
@@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateFailoverTransactionTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection('mysql7')->create('failover_transaction', function (Blueprint $table) {
$table->id();
$table->string('kodcaw',10);
$table->string('teller',255);
$table->string('old_norujukan',50);
$table->string('new_norujukan',50)->nullable();
$table->boolean('db_caw')->default(false); // Boolean for db_caw, default to false
$table->boolean('db_online')->default(false);
$table->enum('status', ['pending', 'resolved', 'failed'])->default('pending'); // Use ENUM for statuses
$table->timestamp('resolve_time')->nullable(); // Timestamp for resolve time, nullable
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection('mysql7')->dropIfExists('failover_transaction');
}
}