Commit 9da8998da596cc853894fb6c6feaf4f95536e8c9

Authored by kevin_fourie
1 parent 1ac1e7b4

KTC-656 - "DB upgrade fails: DB Error: Constraint violation"

Updated. Fixed for 3.5.4 upgrades too now.

Committed By: Kevin Fourie
Reviewed By: Donald Jackson

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/branches/RB_3.5.4a@9681 c91229c3-7414-0410-bfa2-8a42b809f60b
.gitignore
... ... @@ -10,3 +10,5 @@ plugins/shortcuts/
10 10 plugins/wintools/
11 11 plugins/updatesandmessages/
12 12 var/cache/configcache
  13 +bin/luceneserver/lucene.pid
  14 +plugins/.gitignore
... ...
lib/upgrades/UpgradeFunctions.inc.php
... ... @@ -62,8 +62,7 @@ class UpgradeFunctions {
62 62 '3.5.0' => array('cleanupOldKTAdminVersionNotifier', 'updateConfigFile35', 'registerIndexingTasks'),
63 63 '3.5.2' => array('setStorageEngine','dropForeignKeys','dropPrimaryKeys','dropIndexes','createPrimaryKeys','createForeignKeys','createIndexes', 'removeSlashesFromObjects'),
64 64 '3.5.3' => array('moveConfigSettingsToDB','removeAdminVersionNotifier','removeOldSearchPlugins','addAutoIncrementToTables', 'addAutoIncrementToTables2'),
65   - '3.5.4' => array('createIndexes'),
66   - '3.5.4' => array('createIndexes', 'updateServerConfigSettings','removeOldFilesAndFolders354')
  65 + '3.5.4' => array('createIndexes', 'updateServerConfigSettings','removeOldFilesAndFolders354','removeOldFilesAndFolders354a')
67 66 );
68 67  
69 68 var $descriptions = array(
... ... @@ -99,6 +98,7 @@ class UpgradeFunctions {
99 98 'removeOldSearchPlugins' => 'Remove the old Search Plugins.',
100 99 'addAutoIncrementToTables' => 'Update all current db tables to use auto_increment.',
101 100 'removeOldFilesAndFolders354' => 'Remove old files and folders that are no longer needed.',
  101 + 'removeOldFilesAndFolders354a' => 'Remove old files and folders that are no longer needed.',
102 102 'addAutoIncrementToTables2' => 'Update all new db tables to use auto_increment.',
103 103 'updateServerConfigSettings' => 'Update the configuration settings for the server with the correct port'
104 104 );
... ... @@ -122,7 +122,7 @@ class UpgradeFunctions {
122 122 var $priority = array(
123 123 'addAutoIncrementToTables'=>1,
124 124 'addAutoIncrementToTables2'=>-1,
125   - 'removeOldFilesAndFolders354'=>1
  125 + 'removeOldFilesAndFolders354a'=>1
126 126 );
127 127  
128 128 function addAutoIncrementToTables2()
... ... @@ -1381,6 +1381,15 @@ class UpgradeFunctions {
1381 1381 return true;
1382 1382 }
1383 1383  
  1384 + // {{{ removeOldFilesAndFolders354a
  1385 + function removeOldFilesAndFolders354a() {
  1386 + global $default;
  1387 + $oldFile = KT_DIR . "/sql/mysql/upgrade/3.5.4/server_name.sql";
  1388 + if(file_exists($oldFile)) unlink($oldFile);
  1389 +
  1390 + return true;
  1391 + }
  1392 +
1384 1393 function updateServerConfigSettings() {
1385 1394 global $default;
1386 1395 $port = $_SERVER['SERVER_PORT']+0;
... ...