mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-14 13:33:14 +00:00
Fix upgrade tables
This commit is contained in:
@@ -299,7 +299,7 @@ class appbox extends base
|
||||
|
||||
public function forceUpgrade(Setup_Upgrade &$upgrader)
|
||||
{
|
||||
$upgrader->add_steps(7 + count($this->get_databoxes()));
|
||||
$upgrader->add_steps(8 + count($this->get_databoxes()));
|
||||
|
||||
$registry = $this->get_registry();
|
||||
|
||||
@@ -313,6 +313,21 @@ class appbox extends base
|
||||
}
|
||||
$upgrader->add_steps_complete(1);
|
||||
|
||||
|
||||
$upgrader->set_current_message(_('Creating new tables'));
|
||||
$core = bootstrap::getCore();
|
||||
$em = $core->getEntityManager();
|
||||
//create schema
|
||||
|
||||
if($em->getConnection()->getDatabasePlatform()->supportsAlterTable())
|
||||
{
|
||||
$tool = new \Doctrine\ORM\Tools\SchemaTool($em);
|
||||
$metas = $em->getMetadataFactory()->getAllMetadata();
|
||||
$tool->updateSchema($metas, true);
|
||||
}
|
||||
|
||||
$upgrader->add_steps_complete(1);
|
||||
|
||||
/**
|
||||
* Step 2
|
||||
*/
|
||||
|
@@ -842,10 +842,6 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
|
||||
unlink(Setup_Upgrade::get_lock_file());
|
||||
}
|
||||
|
||||
$upgrader = new Setup_Upgrade($appbox);
|
||||
$appbox->forceUpgrade($upgrader);
|
||||
unset($upgrader);
|
||||
|
||||
if (null !== self::$core)
|
||||
{
|
||||
/* @var $em \Doctrine\ORM\EntityManager */
|
||||
@@ -866,6 +862,10 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
|
||||
$tool->createSchema($metas);
|
||||
}
|
||||
|
||||
$upgrader = new Setup_Upgrade($appbox);
|
||||
$appbox->forceUpgrade($upgrader);
|
||||
unset($upgrader);
|
||||
|
||||
self::$updated = true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user