<?php

namespace Tenant\Database\Migrations;

use CodeIgniter\Database\Migration;

/**
 * Staff profile photo — same handle_image_upload()/UploadController::
 * serve() pattern already used for tenant logos/menu photos/room type
 * photos (JPG/PNG/WEBP, 2MB cap). Nullable: falls back to the existing
 * initials-avatar wherever this is null, so nothing breaks for staff who
 * never upload one.
 */
class AddPhotoPathToUsers extends Migration
{
    public function up()
    {
        $this->forge->addColumn('users', [
            'photo_path' => [
                'type'       => 'VARCHAR',
                'constraint' => 255,
                'null'       => true,
                'after'      => 'phone',
            ],
        ]);
    }

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