<?php

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

return new class extends Migration {
    public function up(): void
    {
        Schema::table('serenata_packages', function (Blueprint $table) {
            $table->decimal('internal_cost', 12, 2)->default(0)->after('base_price');
        });

        DB::table('serenata_packages')->update([
            'internal_cost' => DB::raw('base_price'),
        ]);
    }

    public function down(): void
    {
        Schema::table('serenata_packages', function (Blueprint $table) {
            $table->dropColumn('internal_cost');
        });
    }
};
