Files
thecrimesynticate/database/migrations/2026_06_26_231716_create_locations_table.php
T
2026-06-27 14:38:18 +03:00

39 lines
1.0 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('locations', function (Blueprint $table) {
$table->id();
$table->string('name', 100);
$table->string('slug', 100)->unique();
$table->text('description')->nullable();
$table->unsignedInteger('travel_cost')->default(0);
$table->unsignedInteger('requires_level')->nullable()->default(null);
$table->unsignedBigInteger('faction_control')->nullable();
$table->timestamps();
// Indexes
$table->index('slug');
$table->index('requires_level');
$table->index('faction_control');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('locations');
}
};