- 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
47 lines
1.4 KiB
PHP
Executable File
47 lines
1.4 KiB
PHP
Executable File
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
/**
|
|
* Creates the "buildings" table.
|
|
*
|
|
* Player-constructed structures (houses, etc.) placed on free terrain.
|
|
* Construction advances via the world ticker until is_complete.
|
|
*/
|
|
return new class extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*/
|
|
public function up(): void
|
|
{
|
|
Schema::create('buildings', function (Blueprint $table): void {
|
|
$table->id();
|
|
$table->foreignId('city_id')->constrained('cities')->cascadeOnDelete();
|
|
$table->foreignId('owner_character_id')->nullable()->constrained('characters')->nullOnDelete();
|
|
$table->string('type', 40)->default('house');
|
|
$table->string('name', 160)->nullable();
|
|
$table->decimal('pos_x', 10, 2);
|
|
$table->decimal('pos_z', 10, 2);
|
|
$table->decimal('width', 8, 2)->default(10);
|
|
$table->decimal('depth', 8, 2)->default(10);
|
|
$table->decimal('height', 8, 2)->default(5);
|
|
$table->boolean('is_complete')->default(false)->index();
|
|
$table->unsignedTinyInteger('build_progress')->default(0);
|
|
$table->timestamps();
|
|
|
|
$table->index(['city_id', 'type']);
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('buildings');
|
|
}
|
|
};
|