<?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('rahdari_point_histories', function (Blueprint $table) {
            $table->after('user_id', function (Blueprint $table) {
                $table->unsignedSmallInteger('previous_province_id')->nullable();
                $table->string('previous_province_name')->nullable();
                $table->unsignedSmallInteger('previous_city_id')->nullable();
                $table->string('previous_city_name')->nullable();
                $table->string('previous_name')->nullable();
            });
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('rahdari_point_histories', function (Blueprint $table) {
            $table->dropColumn([
                'previous_province_id',
                'previous_province_name',
                'previous_city_id',
                'previous_city_name',
                'previous_name',
            ]);
        });
    }
};
