CC-2600 : Upgrading from 1.8->1.9 wipe all shows content
check if there were any files in stor.
This commit is contained in:
parent
137ca79db8
commit
1660899096
1 changed files with 11 additions and 8 deletions
|
@ -621,15 +621,18 @@ class Airtime190Upgrade{
|
||||||
exec($command, $output);
|
exec($command, $output);
|
||||||
print_r($output);
|
print_r($output);
|
||||||
|
|
||||||
$oldAndNewFileNames = json_decode($output[0]);
|
if (isset($output[0])) {
|
||||||
|
|
||||||
$stor_dir_id = $propel_stor_dir->getId();
|
$oldAndNewFileNames = json_decode($output[0]);
|
||||||
foreach ($oldAndNewFileNames as $pair){
|
|
||||||
$relPathNew = pg_escape_string(substr($pair[1], strlen($stor_dir)));
|
$stor_dir_id = $propel_stor_dir->getId();
|
||||||
$absPathOld = pg_escape_string($pair[0]);
|
foreach ($oldAndNewFileNames as $pair){
|
||||||
$sql = "UPDATE cc_files SET filepath = '$relPathNew', directory=$stor_dir_id WHERE filepath = '$absPathOld'";
|
$relPathNew = pg_escape_string(substr($pair[1], strlen($stor_dir)));
|
||||||
echo $sql.PHP_EOL;
|
$absPathOld = pg_escape_string($pair[0]);
|
||||||
Airtime190Upgrade::execSqlQuery($sql);
|
$sql = "UPDATE cc_files SET filepath = '$relPathNew', directory=$stor_dir_id WHERE filepath = '$absPathOld'";
|
||||||
|
echo $sql.PHP_EOL;
|
||||||
|
Airtime190Upgrade::execSqlQuery($sql);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "Upgrading Linked Files".PHP_EOL;
|
echo "Upgrading Linked Files".PHP_EOL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue