From ee45499e7a10b9177290c84ef6f8ee29a75c0aed Mon Sep 17 00:00:00 2001 From: Matt Young Date: Thu, 26 Jun 2025 09:15:50 -0500 Subject: [PATCH] Migration to add bonus score related columns to the total scores table. --- ...dd_bonus_columns_to_entry_total_scores.php | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 database/migrations/2025_06_26_131356_add_bonus_columns_to_entry_total_scores.php diff --git a/database/migrations/2025_06_26_131356_add_bonus_columns_to_entry_total_scores.php b/database/migrations/2025_06_26_131356_add_bonus_columns_to_entry_total_scores.php new file mode 100644 index 0000000..54c4c08 --- /dev/null +++ b/database/migrations/2025_06_26_131356_add_bonus_columns_to_entry_total_scores.php @@ -0,0 +1,32 @@ +decimal('bonus_total', 9, 6)->nullable()->after('advancement_subscore_totals'); + $table->decimal('seating_total_with_bonus', 9, 6) + ->storedAs('seating_total + COALESCE(bonus_total, 0)') + ->after('bonus_total'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('entry_total_scores', function (Blueprint $table) { + $table->dropColumn('bonus_total'); + $table->dropColumn('seating_total_with_bonus'); + }); + } +};