<?php

namespace Tenant\Database\Migrations;

use CodeIgniter\Database\Migration;

/**
 * Menu item photos — flagged as a real gap (no upload feature existed
 * anywhere in the app until app/Helpers/upload_helper.php). Nullable:
 * most items will never get a photo, and the menu list/order picker
 * both already work fine without one.
 */
class AddPhotoPathToMenuItems extends Migration
{
    public function up()
    {
        $this->forge->addColumn('menu_items', [
            'photo_path' => [
                'type'       => 'VARCHAR',
                'constraint' => 255,
                'null'       => true,
                'after'      => 'category',
            ],
        ]);
    }

    public function down()
    {
        $this->forge->dropColumn('menu_items', ['photo_path']);
    }
}
