api/database/migrations/2025_12_18_092945_create_hu...

51 lines
1.3 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('hunts', function (Blueprint $table) {
$table->string('partner_id')->index();
$table->string('title');
$table->string('slug')->unique();
$table->text('description')->nullable();
$table->string('status')->index();
$table->string('difficulty')->index();
$table->string('city')->index();
$table->decimal('latitude', 10, 7)->nullable();
$table->decimal('longitude', 10, 7)->nullable();
$table->boolean('is_public')->default(false);
$table->unsignedSmallInteger('estimated_duration_min')->nullable();
$table->timestamp('start_at')->nullable();
$table->timestamp('end_at')->nullable();
$table->string('image')->nullable();
$table->foreignId('creator_id')->nullable()->constrained('users')->nullOnDelete();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('hunts');
}
};