<?php

class Migration_20250910194457_create_deleted_doors
{
    public static function up(PDO $pdo)
    {
        // Create the table with the specified columns
        $sql = "
            CREATE TABLE IF NOT EXISTS `delete_gate_doors` (
                `id` INT AUTO_INCREMENT PRIMARY KEY,
                `data` LONGTEXT NOT NULL,
                `property_id` INT DEFAULT NULL,
                `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
                `deleted_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
            )
        ";
        $pdo->exec($sql);
    }

    public static function down(PDO $pdo)
    {
        // Drop the table if it exists
        $sql = "
            DROP TABLE IF EXISTS `delete_gate_doors`
        ";
        $pdo->exec($sql);
    }
}
