mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
fix for bug 5205
This commit is contained in:
parent
c125d80c3e
commit
34d495d1ba
@ -135,6 +135,16 @@ function backup_upgrade($oldversion=0) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// code to drop the prefix in tables
|
||||
if ($oldversion < 2006042100) {
|
||||
$result = execute_sql("ALTER TABLE {$CFG->prefix}backup_files DROP INDEX {$CFG->prefix}backup_files_uk");
|
||||
$result = execute_sql("ALTER TABLE {$CFG->prefix}backup_ids DROP INDEX {$CFG->prefix}backup_ids_uk");
|
||||
$result = execute_sql("ALTER TABLE {$CFG->prefix}backup_files ADD UNIQUE INDEX {$CFG->prefix}backup_files_uk(backup_code,file_type(10),path(255))");
|
||||
$result = execute_sql("ALTER TABLE {$CFG->prefix}backup_ids ADD UNIQUE INDEX {$CFG->prefix}backup_ids_uk(backup_code,table_name(30),old_id)");
|
||||
}
|
||||
|
||||
|
||||
//Finally, return result
|
||||
return $result;
|
||||
|
||||
|
@ -10,7 +10,7 @@ CREATE TABLE `prefix_backup_files` (
|
||||
`old_id` int(10) unsigned default NULL,
|
||||
`new_id` int(10) unsigned default NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `prefix_backup_files_uk` (`backup_code`,`file_type`,`path`)
|
||||
UNIQUE KEY `backup_files_uk` (`backup_code`,`file_type`,`path`)
|
||||
) TYPE=MyISAM COMMENT='To store and recode ids to user and course files.';
|
||||
# --------------------------------------------------------
|
||||
|
||||
@ -26,7 +26,7 @@ CREATE TABLE `prefix_backup_ids` (
|
||||
`new_id` int(10) unsigned default NULL,
|
||||
`info` mediumtext,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `prefix_backup_ids_uk` (`backup_code` ,`table_name`,`old_id`)
|
||||
UNIQUE KEY `backup_ids_uk` (`backup_code` ,`table_name`,`old_id`)
|
||||
) TYPE=MyISAM COMMENT='To store and convert ids in backup/restore';
|
||||
# --------------------------------------------------------
|
||||
|
||||
|
@ -5,6 +5,6 @@
|
||||
// database (backup_version) to determine whether upgrades should
|
||||
// be performed (see db/backup_*.php)
|
||||
|
||||
$backup_version = 2006032900; // The current version is a date (YYYYMMDDXX)
|
||||
$backup_version = 2006042100; // The current version is a date (YYYYMMDDXX)
|
||||
|
||||
$backup_release = "1.6beta1"; // User-friendly version number
|
||||
|
Loading…
x
Reference in New Issue
Block a user