<?php

class Migration_20241105185139_create_table_door_camera
{
    public static function up(PDO $pdo)
    {
        // Your migration code here
        $query = "
            CREATE TABLE door_cameras (
                id INT AUTO_INCREMENT PRIMARY KEY,
                door_id INT NOT NULL,
                camera_id INT NOT NULL,
                FOREIGN KEY (door_id) REFERENCES gate_doors(id) ON DELETE CASCADE,
                FOREIGN KEY (camera_id) REFERENCES live_camera_streaming_data(id) ON DELETE CASCADE
            );
        ";
        $pdo->exec($query);
    }

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