<?php

class Migration_20250326000530_alter_user_tbls
{
    public static function up(PDO $pdo)
    {
        $queries = [
            "ALTER TABLE users ADD COLUMN has_2fa TINYINT(1) NOT NULL DEFAULT 0",
            "ALTER TABLE property_users ADD COLUMN has_2fa TINYINT(1) NOT NULL DEFAULT 0",
            "ALTER TABLE dealer_admins ADD COLUMN has_2fa TINYINT(1) NOT NULL DEFAULT 0"
        ];

        foreach ($queries as $query) {
            $pdo->exec($query);
        }
    }

    public static function down(PDO $pdo)
    {
        $queries = [
            "ALTER TABLE users DROP COLUMN has_2fa",
            "ALTER TABLE property_users DROP COLUMN has_2fa",
            "ALTER TABLE dealer_admins DROP COLUMN has_2fa"
        ];

        foreach ($queries as $query) {
            $pdo->exec($query);
        }
    }
}
