mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 07:56:06 +02:00
MDL-45205 backup: avoid oracle incompatible query
Instead of aliasing column name with sql, use the backup API.
This commit is contained in:
parent
085c68d959
commit
452ef53428
@ -379,13 +379,7 @@ class backup_section_structure_step extends backup_structure_step {
|
||||
$section->add_child($formatoptions);
|
||||
|
||||
// Define sources.
|
||||
// The 'availability' field needs to be renamed because it clashes with
|
||||
// the old nested element structure for availability data.
|
||||
$section->set_source_sql("
|
||||
SELECT *, availability AS availabilityjson
|
||||
FROM {course_sections} WHERE id = ?",
|
||||
array('id' => backup::VAR_SECTIONID));
|
||||
|
||||
$section->set_source_table('course_sections', array('id' => backup::VAR_SECTIONID));
|
||||
$formatoptions->set_source_sql('SELECT cfo.id, cfo.format, cfo.name, cfo.value
|
||||
FROM {course} c
|
||||
JOIN {course_format_options} cfo
|
||||
@ -395,6 +389,9 @@ class backup_section_structure_step extends backup_structure_step {
|
||||
|
||||
// Aliases
|
||||
$section->set_source_alias('section', 'number');
|
||||
// The 'availability' field needs to be renamed because it clashes with
|
||||
// the old nested element structure for availability data.
|
||||
$section->set_source_alias('availability', 'availabilityjson');
|
||||
|
||||
// Set annotations
|
||||
$section->annotate_files('course', 'section', 'id');
|
||||
|
Loading…
x
Reference in New Issue
Block a user