Generates pt-online-schema-change commands for MySQL, given the ALTER TABLE query.
composer require fattureincloud/pt-command-generator
use MadBit\PtCommandGenerator\Generator;
$query = "ALTER TABLE customers ADD COLUMN middle_name VARCHAR(255) NOT NULL AFTER first_name;";
$generator = new Generator($query);
$commands = $generator->getCommands();
# $commands will be an array of strings, each one representing a command to be executed
# $commands[0]: pt-online-schema-change --alter "ADD COLUMN middle_name VARCHAR(255) NOT NULL AFTER first_name" h=$HOST,D=$DBNAME,t=customers,u=$DBUSERNAME,p=$DBPWD