exec($sql); echo "Successfully applied migration: " . basename($file) . PHP_EOL; } catch (PDOException $e) { echo "Error applying migration " . basename($file) . ": " . $e->getMessage() . PHP_EOL; } } } runMigrations();