<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        $table_name = "users";
        if (!Schema::hasColumn($table_name , 'branding')) {
            Schema::table($table_name, function (Blueprint $table) {
                $table->text('branding')->nullable();
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        $table_name = "users";
        if (Schema::hasColumn($table_name , 'branding')) {
            Schema::table($table_name, function (Blueprint $table) {
                $table->dropColumn('branding');
            });
        }
    }
};
