Create entry total score model and table.

This commit is contained in:
Matt Young 2025-06-11 23:32:16 -05:00
parent e800937f4d
commit f0f8038e8a
2 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,11 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class EntryTotalScore extends Model
{
use HasFactory;
}

View File

@ -0,0 +1,32 @@
<?php
use App\Models\Entry;
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::create('entry_total_scores', function (Blueprint $table) {
$table->id();
$table->foreignIdFor(Entry::class)->constrained()->cascadeOnDelete()->cascadeOnUpdate();
$table->decimal('seating_total', 9, 6);
$table->decimal('advancement_total', 9, 6);
$table->json('subscore_totals');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('entry_total_scores');
}
};