<?php

class Migration_20250910194424_create_deleted_cameras
{
    public static function up(PDO $pdo)
    {
        // Create the table with the specified columns
        $sql = "
            CREATE TABLE IF NOT EXISTS `delete_live_camera_streaming_data` (
                `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_live_camera_streaming_data`
        ";
        $pdo->exec($sql);
    }
}
