feat(world): add persistent citizen simulation with needs, jobs, and social features
- Adds Character model with survival needs (hunger, thirst, energy) and state machine - Implements city:tick world ticker for offline progression every minute - Adds city territory expansion and building construction system - Introduces job economy, inventory, and transaction audit trail - Adds social graph (friends, marriage, children) and character chat - Implements admin approval workflow for new registrations - Adds hospital admission system for traffic accidents - Includes comprehensive feature tests and world seeders
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
/**
|
||||
* Creates the "relationships" table.
|
||||
*
|
||||
* Social graph between characters: friends, spouses and parent-child links.
|
||||
* For parent_child, character_a is the child and character_b is the parent.
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('relationships', function (Blueprint $table): void {
|
||||
$table->id();
|
||||
$table->foreignId('character_a_id')->constrained('characters')->cascadeOnDelete();
|
||||
$table->foreignId('character_b_id')->constrained('characters')->cascadeOnDelete();
|
||||
$table->string('type', 30);
|
||||
$table->string('status', 20)->default('pending');
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique(['character_a_id', 'character_b_id', 'type']);
|
||||
$table->index(['character_b_id', 'type', 'status']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('relationships');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user