From f724f450f2125c000fd3be3708979202a2a28023 Mon Sep 17 00:00:00 2001 From: hackerESQ Date: Fri, 24 Jan 2025 19:17:55 -0600 Subject: [PATCH] fix: make default for currency values not nullable --- .../2021_09_06_014744_create_holdings_table.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/database/migrations/2021_09_06_014744_create_holdings_table.php b/database/migrations/2021_09_06_014744_create_holdings_table.php index c4a9692..e43f690 100644 --- a/database/migrations/2021_09_06_014744_create_holdings_table.php +++ b/database/migrations/2021_09_06_014744_create_holdings_table.php @@ -20,10 +20,10 @@ class CreateHoldingsTable extends Migration $table->foreignIdFor(Portfolio::class, 'portfolio_id')->constrained()->onDelete('cascade'); $table->foreignIdFor(MarketData::class, 'symbol'); $table->float('quantity', 12, 4); - $table->float('average_cost_basis', 12, 4); - $table->float('total_cost_basis', 12, 4)->nullable(); - $table->float('realized_gain_dollars', 12, 4)->nullable(); - $table->float('dividends_earned', 12, 4)->nullable(); + $table->float('average_cost_basis', 12, 4)->default(0); + $table->float('total_cost_basis', 12, 4)->default(0); + $table->float('realized_gain_dollars', 12, 4)->default(0); + $table->float('dividends_earned', 12, 4)->default(0); $table->timestamp('splits_synced_at')->nullable(); $table->timestamps(); });