1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 01:08:50 +02:00
phorge-phorge/resources/sql/autopatches/20140323.harbor.1.renames.php

36 lines
830 B
PHP
Raw Normal View History

<?php
$names = array(
'CommandBuildStepImplementation',
'LeaseHostBuildStepImplementation',
'PublishFragmentBuildStepImplementation',
'SleepBuildStepImplementation',
'UploadArtifactBuildStepImplementation',
'WaitForPreviousBuildStepImplementation',
);
$tables = array(
id(new HarbormasterBuildStep())->getTableName(),
id(new HarbormasterBuildTarget())->getTableName(),
);
echo pht('Renaming Harbormaster classes...')."\n";
$conn_w = id(new HarbormasterBuildStep())->establishConnection('w');
foreach ($names as $name) {
$old = $name;
$new = 'Harbormaster'.$name;
echo pht('Renaming %s -> %s...', $old, $new)."\n";
foreach ($tables as $table) {
queryfx(
$conn_w,
'UPDATE %T SET className = %s WHERE className = %s',
$table,
$new,
$old);
}
}
echo pht('Done.')."\n";