mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-24 10:23:17 +00:00
Bad ordering of indexes operations in DBAL-2.5
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Alchemy\Tests\Phrasea\Setup\Version;
|
namespace Alchemy\Tests\Phrasea\Setup\Version;
|
||||||
|
|
||||||
|
use Alchemy\Phrasea\Model\Entities\Session;
|
||||||
use Alchemy\Phrasea\Setup\Version\PreSchemaUpgrade\Upgrade39Users;
|
use Alchemy\Phrasea\Setup\Version\PreSchemaUpgrade\Upgrade39Users;
|
||||||
use Alchemy\Phrasea\Model\Entities\User;
|
use Alchemy\Phrasea\Model\Entities\User;
|
||||||
use Doctrine\DBAL\DBALException;
|
use Doctrine\DBAL\DBALException;
|
||||||
@@ -83,6 +84,16 @@ class Upgrade39UsersTest extends \PhraseanetTestCase
|
|||||||
{
|
{
|
||||||
$tool = new SchemaTool($em);
|
$tool = new SchemaTool($em);
|
||||||
$metas = $em->getMetadataFactory()->getAllMetadata();
|
$metas = $em->getMetadataFactory()->getAllMetadata();
|
||||||
|
|
||||||
|
// Bad ordering of Indexes changes in Doctrine DBAL-2.5
|
||||||
|
$sqls = $tool->getUpdateSchemaSql($metas, true);
|
||||||
|
foreach ($sqls as $sql) {
|
||||||
|
if ('DROP INDEX usr_id ON Sessions' === $sql) {
|
||||||
|
$em->getConnection()->executeQuery($sql);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// End patching DBAL-2.5
|
||||||
|
|
||||||
$tool->updateSchema($metas, true);
|
$tool->updateSchema($metas, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user