<?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('lesen_penjajas', function (Blueprint $table) {
            // Change the 'age' column from string to integer, and keep it nullable
            $table->integer('jenis_penjaja_id')->after('syarikat_id')->nullable();
            $table->dropColumn('jenis');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        //
        Schema::table('lesen_penjajas', function (Blueprint $table) {
            // Change the 'age' column from string to integer, and keep it nullable
            $table->enum('jenis', ['bukan kawasan berpusat','buah bermusim','food truck','foodtruck','car boot sale','berkenderaan','gerai','arked','pasar majlis','berpusat','sementara','lain-lain'])->after('syarikat_id')->nullable();
            $table->dropColumn('jenis_penjaja_id');
        });
    }
};
