27 lines
716 B
PHP
27 lines
716 B
PHP
|
|
<?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');
|
||
|
|
}
|
||
|
|
};
|