Skip to content

Commit c110bf9

Browse files
author
mjollnir_
committed
Attempt to fix bad constraint name in wiki and version bump (honoring partial freeze) and requires bump (needs changes in execute_sql to not show adodb feedback)
1 parent c692322 commit c110bf9

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

mod/wiki/db/postgres7.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ function wiki_upgrade($oldversion) {
4545
modify_database('','CREATE INDEX prefix_wiki_entries_course_idx ON prefix_wiki_entries (course);');
4646
modify_database('','CREATE INDEX prefix_wiki_entries_pagename_idx ON prefix_wiki_entries (pagename);');
4747
}
48+
49+
if ($oldversion < 2004083125) {
50+
execute_sql("ALTER TABLE {$CFG->prefix}wiki_pages DROP CONSTRAINT id;",false);
51+
execute_sql("ALTER TABLE {$CFG->prefix}wiki_pages DROP CONSTRAINT {$CFG->prefix}wiki_pages_id;",false);
52+
execute_sql("ALTER TABLE {$CFG->prefix}wiki_pages DROP CONSTRAINT {$CFG->prefix}wiki_pages_pagename_version_wiki_unique;",false);
53+
modify_database("", "ALTER TABLE ONLY prefix_wiki_pages
54+
ADD CONSTRAINT prefix_wiki_pages_pagename_version_wiki_unique PRIMARY KEY (pagename, \"version\", wiki);");
55+
}
4856

4957
return true;
5058
}

mod/wiki/version.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
66
/////////////////////////////////////////////////////////////////////////////////
77

8-
$module->version = 2004083124; // The current module version (Date: YYYYMMDDXX)
9-
$module->requires = 2004083123; // Requires this Moodle version
8+
$module->version = 2004083125; // The current module version (Date: YYYYMMDDXX)
9+
$module->requires = 2004083129; // Requires this Moodle version
1010
$module->cron = 0; // Period for cron to check this module (secs)
1111

1212
?>

0 commit comments

Comments
 (0)