<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('services', function (Blueprint $table) {
            $table->id();
            $table->timestamps();
            $table->uuid('slug');
            $table->string('title');
            $table->longText('description');
            $table->boolean('three_tiers')->default(true);
            $table->double('basic_tier_price')->nullable();
            $table->double('standard_tier_price')->nullable();
            $table->double('pro_tier_price')->nullable();
            $table->integer('basic_tier_days')->nullable();
            $table->integer('standard_tier_days')->nullable();
            $table->integer('pro_tier_days')->nullable();
            $table->enum('status',["Published","Paused","Drafted"])->default("Published");
            $table->foreignId('category_id')->default(1);
            $table->unsignedBigInteger('serviceable_id');
            $table->string('serviceable_type');
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('services');
    }
};
