game-village-politics-backend/database/migrations/2026_11_02_090000_create_wo...

27 lines
716 B
PHP
Raw Permalink Normal View History

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
// The Lazarett: the wounded of one battle lie in a village's hospital until heals_at.
return new class extends Migration
{
public function up(): void
{
Schema::create('wounded', function (Blueprint $table) {
$table->id();
$table->foreignId('village_id')->constrained()->cascadeOnDelete();
// unit => count
$table->json('units');
$table->dateTime('heals_at', 3);
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('wounded');
}
};