Fix version table creation, before doctrine migrations creates it.

See #1824
remotes/angel/1.11.x
jmontoyaa 8 years ago
parent 3cc010339a
commit 0b14bc3c0f
  1. 3
      main/install/index.php
  2. 6
      main/install/install.lib.php

@ -768,6 +768,9 @@ if (@$_POST['step2']) {
$dbPortForm
);
$sql = getVersionTable();
$manager->getConnection()->executeQuery($sql);
$metadataList = $manager->getMetadataFactory()->getAllMetadata();
$schema = $manager->getConnection()->getSchemaManager()->createSchema();

@ -2077,6 +2077,7 @@ function installSettings(
* @param string $chamiloVersion
* @param EntityManager $manager
* @throws \Doctrine\DBAL\DBALException
* @return bool
*/
function migrate($chamiloVersion, EntityManager $manager)
{
@ -2106,7 +2107,6 @@ function migrate($chamiloVersion, EntityManager $manager)
$to = null; // if $to == null then schema will be migrated to latest version
echo "<pre>";
try {
// Execute migration!
$migratedSQL = $migration->migrate($to);
@ -2747,9 +2747,9 @@ function finishInstallation(
$sysPath = !empty($sysPath) ? $sysPath : api_get_path(SYS_PATH);
$connection = $manager->getConnection();
$sql = getVersionTable();
// Add version table
$connection->executeQuery('CREATE TABLE IF NOT EXISTS version (id int unsigned NOT NULL AUTO_INCREMENT, version varchar(20), PRIMARY KEY(id), UNIQUE(version))');
$connection->executeQuery($sql);
// Add tickets defaults
$ticketProject = new TicketProject();

Loading…
Cancel
Save