Commit 018c0aa6 authored by Aaron Wells's avatar Aaron Wells
Browse files

Silence warnings during upgrade (from 1.3 & earlier) about indexes having no columns.

Bug 1243525

Change-Id: I9555d15d9a08bb1e01e30e12f1ac2125535c55fa
parent 5b0b2542
......@@ -1452,6 +1452,7 @@ function xmldb_core_upgrade($oldversion=0) {
// Restore index that may be missing due to upgrade 2011050600.
$table = new XMLDBTable('usr');
$index = new XMLDBIndex('usr_use_uix');
$index->setAttributes(XMLDB_INDEX_UNIQUE, array('username'));
if (!index_exists($table, $index)) {
if (is_postgres()) {
// For postgres, create the index on the lowercase username, the way it's
......@@ -1527,6 +1528,7 @@ function xmldb_core_upgrade($oldversion=0) {
if (is_postgres()) {
$table = new XMLDBTable('usr');
$index = new XMLDBIndex('usr_fir_ix');
$index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('firstname', 'lastname', 'preferredname', 'studentid', 'email'));
if (!index_exists($table, $index)) {
execute_sql('CREATE INDEX {usr_fir_ix} ON {usr}(LOWER(firstname))');
execute_sql('CREATE INDEX {usr_las_ix} ON {usr}(LOWER(lastname))');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment