Files
investbrain/database/migrations/2024_10_18_000001_add_reinvestment_columns.php
T

39 lines
973 B
PHP
Raw Normal View History

2024-10-18 20:46:22 -05:00
<?php
2025-01-28 17:33:54 -06:00
declare(strict_types=1);
2024-10-18 20:46:22 -05:00
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::table('holdings', function (Blueprint $table) {
2025-01-24 19:15:28 -06:00
$table->boolean('reinvest_dividends')->default(false)->after('quantity');
2024-10-18 20:46:22 -05:00
});
Schema::table('transactions', function (Blueprint $table) {
2025-01-24 19:15:28 -06:00
$table->boolean('reinvested_dividend')->default(false)->after('split');
2024-10-18 20:46:22 -05:00
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('holdings', function (Blueprint $table) {
$table->dropColumn('reinvest_dividends');
});
Schema::table('transactions', function (Blueprint $table) {
$table->dropColumn('reinvested_dividend');
});
}
};