39498-vm/database/migrations/2026_04_06_055037_create_offers_table.php
2026-04-06 06:10:54 +00:00

38 lines
1.4 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('offers', function (Blueprint $table) {
$table->id();
$table->uuid('uuid')->unique();
$table->string('title');
$table->string('slug')->unique();
$table->enum('category', ['restaurant', 'experience', 'activity', 'product', 'service']);
$table->string('excerpt')->nullable();
$table->text('description')->nullable();
$table->string('location_label')->nullable();
$table->decimal('lat', 10, 7)->nullable();
$table->decimal('lng', 10, 7)->nullable();
$table->decimal('price_from', 10, 2)->nullable();
$table->unsignedInteger('duration_minutes')->nullable();
$table->string('image_url')->nullable();
$table->enum('status', ['draft', 'published', 'paused'])->default('draft');
$table->boolean('is_featured')->default(false);
$table->integer('priority_score')->default(0);
$table->boolean('available_now')->default(true);
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('offers');
}
};