<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;

return new class extends Migration {
    public function up(): void {
        Schema::create('crm_settings', function (Blueprint $t) {
            $t->id(); $t->string('company_name')->default('HIGHRA CRM'); $t->string('company_email')->nullable();
            $t->string('company_phone')->nullable(); $t->text('company_address')->nullable(); $t->string('logo_path')->nullable();
            $t->string('currency',8)->default('INR'); $t->string('timezone',80)->default('Asia/Kolkata'); $t->timestamps();
        });
        DB::table('crm_settings')->insert([
            'company_name'=>env('APP_NAME','HIGHRA CRM'),'currency'=>'INR','timezone'=>'Asia/Kolkata',
            'created_at'=>now(),'updated_at'=>now()
        ]);
    }
    public function down(): void { Schema::dropIfExists('crm_settings'); }
};
