Fixing up a badly named quiz table in postgres. PLEASE remember that you cannot just do RENAME - it breaks the sequences
This commit is contained in:
@@ -1037,6 +1037,13 @@ function quiz_upgrade($oldversion) {
|
||||
table_column('question_sessions', 'sumpenalty', 'sumpenalty', 'real', '', '', '0', 'not null');
|
||||
}
|
||||
|
||||
if ($oldversion < 2006030100) {
|
||||
// Fix up another table rename :(
|
||||
// THIS caused the mistake: execute_sql("ALTER TABLE {$CFG->prefix}quiz_newest_states RENAME TO {$CFG->prefix}question_sessions", false);
|
||||
execute_sql('ALTER TABLE '.$CFG->prefix.'quiz_newest_states_id_seq RENAME TO '.$CFG->prefix.'question_sessions_id_seq',false);
|
||||
execute_sql('ALTER TABLE '.$CFG->prefix.'question_sessions ALTER COLUMN id SET DEFAULT nextval(\''.$CFG->prefix.'question_sessions_id_seq\')',false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// This fragment is called by moodle_needs_upgrading() and /admin/index.php
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$module->version = 2006022402; // The (date) version of this module
|
||||
$module->version = 2006030100; // The (date) version of this module
|
||||
$module->requires = 2006022400; // Requires this Moodle version
|
||||
$module->cron = 0; // How often should cron check this module (seconds)?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user