<?php

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

return new class extends Migration {
    public function up()
    {
        if (!Schema::hasTable('clc_module_settings')) {
            Schema::create('clc_module_settings', function (Blueprint $table) {
                $table->increments('id');
                $table->unsignedInteger('business_id');
                $table->string('key', 100);
                $table->text('value')->nullable();
                $table->timestamps();
                $table->unique(['business_id', 'key']);
            });
        }
    }

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