feat(ticket): add refund transaction model
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('ticket_refunds', function (Blueprint $table): void {
|
||||
$table->id();
|
||||
$table->foreignId('ticket_id')->unique()->constrained('tickets')->cascadeOnDelete();
|
||||
$table->foreignId('purchase_item_id')->constrained('compra_items')->restrictOnDelete();
|
||||
$table->foreignId('created_by_user_id')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->string('type', 16);
|
||||
$table->decimal('amount', 10, 2);
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['purchase_item_id', 'type']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('ticket_refunds');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user