<?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('announcements', function (Blueprint $table) {
            $table->string('title', 255)->after('id')->nullable();
            $table->integer('company_id')->after('title')->nullable();
            $table->integer('dealer_id')->after('company_id')->nullable();
            $table->string('created_by', 100)->after('dealer_id')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('announcements', function (Blueprint $table) {
            $table->dropColumn('title');
            $table->dropColumn('company_id');
            $table->dropColumn('dealer_id');
            $table->dropColumn('created_by');
        });
    }
};
