Files
City10/database/migrations/2026_10_18_000200_create_cities_table.php
T
marcocosta10000 79ce2a1825 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
2026-10-17 21:46:23 -03:00

43 lines
1.2 KiB
PHP
Executable File

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* Creates the "cities" table.
*
* Each city owns a rectangular territory (bounds) used to generate the
* street layout, clamp movement and limit construction. Cities can be
* expanded or created by administrators as the platform grows.
*/
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('cities', function (Blueprint $table): void {
$table->id();
$table->string('name', 120);
$table->string('slug', 120)->unique();
$table->decimal('bounds_min_x', 10, 2)->default(-80);
$table->decimal('bounds_max_x', 10, 2)->default(80);
$table->decimal('bounds_min_z', 10, 2)->default(-80);
$table->decimal('bounds_max_z', 10, 2)->default(80);
$table->boolean('is_active')->default(true)->index();
$table->unsignedInteger('expansions')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('cities');
}
};