- 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
39 lines
1.1 KiB
PHP
Executable File
39 lines
1.1 KiB
PHP
Executable File
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
/**
|
|
* Creates the "transactions" table.
|
|
*
|
|
* Audit trail of economic exchanges between characters and stores.
|
|
*/
|
|
return new class extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*/
|
|
public function up(): void
|
|
{
|
|
Schema::create('transactions', function (Blueprint $table): void {
|
|
$table->id();
|
|
$table->foreignId('from_character_id')->nullable()->constrained('characters')->nullOnDelete();
|
|
$table->foreignId('to_character_id')->nullable()->constrained('characters')->nullOnDelete();
|
|
$table->foreignId('store_id')->nullable()->constrained('stores')->nullOnDelete();
|
|
$table->string('item', 40);
|
|
$table->unsignedInteger('qty')->default(1);
|
|
$table->decimal('amount', 12, 2)->default(0);
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('transactions');
|
|
}
|
|
};
|