<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('general_settings', function (Blueprint $table) {
            $table->decimal('reward_level_1')->default(0.00);
            $table->integer('reward_level_1_days')->default(0)->after('reward_level_1');
            $table->decimal('reward_level_2')->default(0.00)->after('reward_level_1_days');
            $table->integer('reward_level_2_days')->default(0)->after('reward_level_2');
            $table->decimal('reward_level_3')->default(0.00)->after('reward_level_2_days');
            $table->integer('reward_level_3_days')->default(0)->after('reward_level_3');
            $table->decimal('reward_level_4')->default(0.00)->after('reward_level_3_days');
            $table->integer('reward_level_4_days')->default(0)->after('reward_level_4');
            $table->decimal('reward_level_5')->default(0.00)->after('reward_level_4_days');
            $table->integer('reward_level_5_days')->default(0)->after('reward_level_5');
            $table->decimal('reward_level_6')->default(0.00)->after('reward_level_5_days');
            $table->integer('reward_level_6_days')->default(0)->after('reward_level_6');
            $table->decimal('reward_level_7')->default(0.00)->after('reward_level_6_days');
            $table->integer('reward_level_7_days')->default(0)->after('reward_level_7');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('general_settings', function (Blueprint $table) {
            $table->dropColumn([
                'reward_level_1',
                'reward_level_1_days',
                'reward_level_2',
                'reward_level_2_days',
                'reward_level_3',
                'reward_level_3_days',
                'reward_level_4',
                'reward_level_4_days',
                'reward_level_5',
                'reward_level_5_days',
                'reward_level_6',
                'reward_level_6_days',
                'reward_level_7',
                'reward_level_7_days',
            ]);

        });
    }
};
