rsabhk-blade/database/migrations/2025_04_27_015218_create_transactions_table.php

33 lines
922 B
PHP

<?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->integer('amount')->default(0);
$table->foreignId('treatment_id')->constrained('treatments')->onDelete('cascade');
$table->foreignId('patien_registration_id')->constrained('patien_registrations')->onDelete('cascade');
$table->foreignId('user_id')->constrained('users')->onDelete('cascade');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('transactions');
}
};