exec($sql); echo "Migration from $file ran successfully.\n"; } catch (PDOException $e) { echo "Error running migration from $file: " . $e->getMessage() . "\n"; } } } } run_migrations();