From 9331e61839aa151c284a972acf341335072c7d89 Mon Sep 17 00:00:00 2001 From: Matt Young Date: Wed, 11 Jun 2025 23:03:49 -0500 Subject: [PATCH] Remove depricated table and create total_scores table --- ..._12_034045_drop_caculated_scores_table.php | 31 ++++++++++++++++++ ...06_12_034242_create_total_scores_table.php | 32 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 database/migrations/2025_06_12_034045_drop_caculated_scores_table.php create mode 100644 database/migrations/2025_06_12_034242_create_total_scores_table.php diff --git a/database/migrations/2025_06_12_034045_drop_caculated_scores_table.php b/database/migrations/2025_06_12_034045_drop_caculated_scores_table.php new file mode 100644 index 0000000..5dd6b4d --- /dev/null +++ b/database/migrations/2025_06_12_034045_drop_caculated_scores_table.php @@ -0,0 +1,31 @@ +id(); + $table->foreignIdFor(Entry::class)->constrained()->cascadeOnDelete()->cascadeOnUpdate(); + $table->string('mode'); + $table->json('calculatedScore'); + $table->timestamps(); + }); + } +}; diff --git a/database/migrations/2025_06_12_034242_create_total_scores_table.php b/database/migrations/2025_06_12_034242_create_total_scores_table.php new file mode 100644 index 0000000..0c5d89d --- /dev/null +++ b/database/migrations/2025_06_12_034242_create_total_scores_table.php @@ -0,0 +1,32 @@ +id(); + $table->foreignIdFor(Entry::class)->constrained()->cascadeOnDelete()->cascadeOnUpdate(); + $table->decimal('seating_total', 9, 6)->after('subscores'); + $table->decimal('advancement_total', 9, 6)->after('seating_total'); + $table->json('subscore_totals'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('total_scores'); + } +};