Files
approagency/database/migrations/2023_06_06_091951_create_transactions_table.php
2026-06-10 08:30:03 +00:00

35 lines
969 B
PHP
Executable File

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('transactions', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->constrained('users')->onDelete('CASCADE');
$table->foreignId('product_id')->nullable()->constrained('products')->onDelete('CASCADE');
$table->bigInteger('amount');
$table->uuid('uuid')->unique();
$table->unsignedTinyInteger('status')->default(1);
$table->string('authority');
$table->string('ref_id')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('transactions');
}
};