mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 17:02:03 +02:00
MDL-33330 Populate referencehash field values
This commit is contained in:
parent
5100365347
commit
dccba8bcc9
@ -779,5 +779,18 @@ function xmldb_main_upgrade($oldversion) {
|
||||
upgrade_main_savepoint(true, 2012060100.01);
|
||||
}
|
||||
|
||||
if ($oldversion < 2012060100.02) {
|
||||
// Populate referencehash field with SHA1 hash of the reference - this shoudl affect only 2.3dev sites
|
||||
// that were using the feature for testing. Production sites have the table empty.
|
||||
$rs = $DB->get_recordset('files_reference', null, '', 'id, reference');
|
||||
foreach ($rs as $record) {
|
||||
$hash = sha1($record->reference);
|
||||
$DB->set_field('files_reference', 'referencehash', $hash, array('id' => $record->id));
|
||||
}
|
||||
$rs->close();
|
||||
|
||||
upgrade_main_savepoint(true, 2012060100.02);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -1938,6 +1938,7 @@ class file_storage {
|
||||
$id = $DB->insert_record('files_reference', array(
|
||||
'repositoryid' => $repositoryid,
|
||||
'reference' => $reference,
|
||||
'referencehash' => sha1($reference),
|
||||
'lastsync' => $lastsync,
|
||||
'lifetime' => $lifetime));
|
||||
} catch (dml_exception $e) {
|
||||
|
@ -30,7 +30,7 @@
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
|
||||
$version = 2012060100.01; // YYYYMMDD = weekly release date of this DEV branch
|
||||
$version = 2012060100.02; // YYYYMMDD = weekly release date of this DEV branch
|
||||
// RR = release increments - 00 in DEV branches
|
||||
// .XX = incremental changes
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user