<?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('sms_senders', function (Blueprint $table): void {
            $table->id();
            $table->foreignId('profile_id')->constrained('sms_profiles')->cascadeOnDelete();
            $table->string('sname'); // provider sender ID
            $table->string('description')->nullable();
            $table->boolean('active')->default(true);
            $table->timestamps();

            $table->unique(['profile_id', 'sname']);
            $table->index(['active']);
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('sms_senders');
    }
};
