~ubuntu-branches/ubuntu/breezy/moodle/breezy

« back to all changes in this revision

Viewing changes to mod/survey/db/postgres7.php

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Mitchell
  • Date: 2005-10-13 02:00:59 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051013020059-y2qcyo41t7nqppcg
Tags: 1.5.2-1ubuntu1
* Resync with debian (security update)
* changed dependencys to php5
* changed apache dependency to apache2 
* References
  CAN-2005-2247

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?PHP // $Id: postgres7.php,v 1.7.8.1 2004/11/21 20:37:31 mjollnir_ Exp $
 
1
<?php // $Id: postgres7.php,v 1.10 2005/03/15 23:12:50 mjollnir_ Exp $
2
2
 
3
3
function survey_upgrade($oldversion) {
4
4
// This function does anything necessary to upgrade
24
24
        modify_database("", "INSERT INTO prefix_log_display VALUES ('survey', 'update', 'survey', 'name');");
25
25
    }
26
26
 
27
 
    if ($oldversion < 2004060401) { 
 
27
    if ($oldversion < 2004111200) { 
 
28
        execute_sql("DROP INDEX {$CFG->prefix}survey_course_idx;",false);
 
29
        execute_sql("DROP INDEX {$CFG->prefix}survey_analysis_survey_idx;",false); 
 
30
        execute_sql("DROP INDEX {$CFG->prefix}survey_analysis_userid_idx;",false); 
 
31
        execute_sql("DROP INDEX {$CFG->prefix}survey_answers_userid_idx;",false);
 
32
        execute_sql("DROP INDEX {$CFG->prefix}survey_answers_survey_idx;",false); 
 
33
        execute_sql("DROP INDEX {$CFG->prefix}survey_answers_question_idx;",false);
 
34
 
28
35
        modify_database('','CREATE INDEX prefix_survey_course_idx ON prefix_survey (course);');
29
36
        modify_database('','CREATE INDEX prefix_survey_analysis_survey_idx ON prefix_survey_analysis (survey);');
30
37
        modify_database('','CREATE INDEX prefix_survey_analysis_userid_idx ON prefix_survey_analysis (userid);');
32
39
        modify_database('','CREATE INDEX prefix_survey_answers_survey_idx ON prefix_survey_answers (survey);');
33
40
        modify_database('','CREATE INDEX prefix_survey_answers_question_idx ON prefix_survey_answers (question);');
34
41
    }
 
42
 
 
43
    if ($oldversion < 2005031600) {
 
44
        execute_sql('SELECT setval(\''.$CFG->prefix.'survey_id_seq\', (select max(id) from '.$CFG->prefix.'survey))');
 
45
        execute_sql('SELECT setval(\''.$CFG->prefix.'survey_questions_id_seq\', (select max(id) from '.$CFG->prefix.'survey_questions))');
 
46
    }
35
47
    return true;
36
48
}
37
49