Files
portal-api/database/migrations/2024_05_13_165053_transaction.php

32 lines
885 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
public function up()
{
Schema::create('transactions', function (Blueprint $table) {
$table->id();
$table->uuid();
$table->string('trans')->nullable();
$table->integer('amount')->nullable();
$table->string('public_code')->nullable();
$table->foreignId('customer_id')
->constrained('customers')
->cascadeOnDelete();
$table->tinyInteger('status')->default(0)->comment('0: pending, 1: completed, 2: fail');
$table->timestamps();
$table->softDeletes();
});
}
public function down()
{
Schema::dropIfExists('transactions');
}
};