<?php

class Migration_20250723022413_ftp_servers_tbl
{
    public static function up(PDO $pdo)
    {
        $sql = "
            CREATE TABLE IF NOT EXISTS ftp_servers (
                id INT AUTO_INCREMENT PRIMARY KEY,
                label VARCHAR(100) NOT NULL,
                url VARCHAR(255) NOT NULL,
                port INT DEFAULT 21,
                is_managed BOOLEAN DEFAULT TRUE,
                active TINYINT(1) DEFAULT 1,
                created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
                updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
            );
        ";

        $pdo->exec($sql);
    }

    public static function down(PDO $pdo)
    {
        $sql = "DROP TABLE IF EXISTS ftp_servers;";
        $pdo->exec($sql);
    }
}
