id(); $table->foreignId('user_id')->constrained()->cascadeOnDelete(); $table->string('name', 50); $table->enum('gender', ['male', 'female', 'other']); $table->unsignedInteger('level')->default(1); $table->unsignedBigInteger('experience')->default(0); $table->unsignedBigInteger('money')->default(5000); $table->unsignedBigInteger('bank')->default(0); $table->unsignedInteger('energy')->default(100); $table->unsignedInteger('max_energy')->default(100); $table->unsignedInteger('health')->default(100); $table->unsignedInteger('max_health')->default(100); $table->unsignedInteger('strength')->default(5); $table->unsignedInteger('defense')->default(5); $table->unsignedInteger('speed')->default(5); $table->unsignedInteger('dexterity')->default(5); $table->foreignId('location_id')->constrained(); $table->unsignedBigInteger('faction_id')->nullable(); $table->timestamp('in_hospital_until')->nullable(); $table->timestamp('in_jail_until')->nullable(); $table->timestamp('last_action_at')->nullable(); $table->enum('status', CharacterStatus::values())->default(CharacterStatus::ACTIVE->value); $table->timestamps(); // Indexes $table->index('user_id'); $table->index('name'); $table->index('level'); $table->index('location_id'); $table->index('faction_id'); $table->index('status'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('characters'); } };