Browse Source

Fix little issue on install - refs CT#8337

Yannick Warnier 8 years ago
parent
commit
307f729c99
2 changed files with 2 additions and 2 deletions
  1. 1 1
      main/install/index.php
  2. 1 1
      main/install/install.lib.php

+ 1 - 1
main/install/index.php

@@ -946,7 +946,7 @@ if (@$_POST['step2']) {
         $connection->executeQuery("ALTER TABLE faq_question ADD CONSTRAINT FK_4A55B05912469DE2 FOREIGN KEY (category_id) REFERENCES faq_category (id);");
         */
         // Add version table
-        $connection->executeQuery('CREATE TABLE version (version varchar(255), PRIMARY KEY(version));');
+        $connection->executeQuery('CREATE TABLE version (id int unsigned NOT NULL AUTO_INCREMENT, version varchar(255), PRIMARY KEY(id));');
 
         // Tickets
         $table = Database::get_main_table(TABLE_TICKET_PROJECT);

+ 1 - 1
main/install/install.lib.php

@@ -2198,7 +2198,7 @@ function finishInstallation(
     $files = $finder->files()->in($path);
     foreach ($files as $version) {
         $version = str_replace(['Version',  '.php' ], '', $version->getFilename());
-        $sql = "INSERT INTO version VALUES ('$version')";
+        $sql = "INSERT INTO version (version) VALUES ('$version')";
         Database::query($sql);
     }
 }