<?php

class Migration_20250123223825_alter_table_visitors
{
    public static function up(PDO $pdo)
    {
        // Your migration code here
        $sql = "
            ALTER TABLE `visitors` ADD COLUMN `visitor_message` Boolean default 0 AFTER `key_code`;
            ALTER TABLE `visitors` ADD COLUMN `visitor_phone` VARCHAR(10) NOT NULL AFTER `cidcode`;
        ";
        $pdo->exec($sql);
    }

    public static function down(PDO $pdo)
    {
        // Rollback code here
        $query = "
            ALTER TABLE visitors
            DROP COLUMN visitor_message;
        ";

        $pdo->exec($query);
        echo "Column removed from `visitors` table successfully.\n";
    }
}