<?php

class Migration_20241031162728_add_column_camera
{
    public static function up(PDO $pdo)
    {
        $query = "
            ALTER TABLE gate_doors 
            ADD COLUMN camera_id INT NULL,
            ADD CONSTRAINT fk_gate_camera_id FOREIGN KEY (camera_id) REFERENCES live_camera_streaming_data(id) ON DELETE SET NULL;
        ";
        $pdo->exec($query);

        
    }

    public static function down(PDO $pdo)
    {
        // Rollback code here
    }
}
