PHRAS-2329 Port to master : log_doc error when move a record between collections (#2867)

* port PHRAS-2317 fix: wrong coll_id in log_docs when move collection

* update
This commit is contained in:
aynsix
2018-12-26 12:41:09 +04:00
committed by jygaulier
parent 331127d091
commit c20d385292
3 changed files with 70 additions and 4 deletions

View File

@@ -0,0 +1,64 @@
<?php
/**
* This file is part of Phraseanet
*
* (c) 2005-2016 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Alchemy\Phrasea\Application;
class patch_410alpha13b implements patchInterface
{
/** @var string */
private $release = '4.1.0-alpha.13b';
/** @var array */
private $concern = [base::DATA_BOX];
/**
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return [];
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
}
/**
* {@inheritdoc}
*/
public function concern()
{
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function apply(base $databox, Application $app)
{
$sql = "UPDATE `log_docs` SET `coll_id`=`final` WHERE `action`='collection'";
$databox->get_connection()->prepare($sql)->execute();
return true;
}
}