sqlMigrate : Allow Debug to display the executed INSERT
This commit is contained in:
@@ -61,6 +61,7 @@ class main
|
||||
$getopts = new getopts ();
|
||||
$getopts->add ("Help", "?h", array ("help"), "Help of the software");
|
||||
$getopts->add ("Step", "", array ("step:"), "Restart at provided step", "StepIdentifier");
|
||||
$getopts->add ("Debug", "", array ("debug"), "Display the SQL requests");
|
||||
if ($getopts->get ("Help"))
|
||||
die ($getopts->help ());
|
||||
if ($getopts->get ("Step"))
|
||||
@@ -327,12 +328,15 @@ class main
|
||||
$dstDB->primary ($dstSchema["primary"]);
|
||||
foreach ($srcDB->directQuery ($sql) as $row)
|
||||
{
|
||||
echo ".";
|
||||
//print_r ($row);
|
||||
$dstDB->clearRequest ();
|
||||
$dstDB->insert ()
|
||||
->setValues ($row)
|
||||
->execute ();
|
||||
->setValues ($row);
|
||||
if (! $getopts->get ("Debug"))
|
||||
echo ".";
|
||||
else
|
||||
echo $dstDB->getDisplayQuery ();
|
||||
$dstDB->execute ();
|
||||
}
|
||||
echo "\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user