<?php

class Migration_20250623170929_drop_foreign_key_on_door
{
    public static function up(PDO $pdo)
    {
        $pdo->exec("
            ALTER TABLE `gate_doors`
            DROP FOREIGN KEY `fk_gate_CreatedBy`
        ");
    }

    public static function down(PDO $pdo)
    {
        $pdo->exec("
            ALTER TABLE `gate_doors`
            ADD CONSTRAINT `fk_gate_CreatedBy`
            FOREIGN KEY (`CreatedBy`) REFERENCES `users`(`id`) ON DELETE SET NULL
        ");
    }
}