Edit File: 2024_09_30_124500_add_columns_to_settlements_table.php
<?php use App\Enums\SettlementType; use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('settlements', function (Blueprint $table) { $table->tinyInteger('type')->default(SettlementType::DUES->value); $table->decimal('indebtedness', 10, 2)->default(0)->comment('Amount of indebtedness'); $table->foreignId('cancel_reason_id')->nullable()->constrained('cancel_reasons')->onDelete('cascade'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('settlements', function (Blueprint $table) { $table->dropColumn('type'); }); } };
Back to File Manager