return false;
}
if ($key->getType() == XMLDB_KEY_PRIMARY) { // Prevent PRIMARY to be added (only in create table, being serious :-P)
- /// TODO print some notify here (id debuglevel is DEVELOPER)
+ debugging('Primary Keys can be added at table creation time only', DEBUG_DEVELOPER);
return true;
}
return false;
}
if ($key->getType() == XMLDB_KEY_PRIMARY) { // Prevent PRIMARY to be dropped (only in drop table, being serious :-P)
- /// TODO print some notify here (id debuglevel is DEVELOPER)
+ debugging('Primary Keys can be deleted at table drop time only', DEBUG_DEVELOPER);
return true;
}
return false;
}
-/// Check there isn't any index with the same fields
- if ($indexexists = find_index_name($table, $index)) {
- /// TODO print some notify here (id debuglevel is DEVELOPER)
+/// Check index doesn't exist
+ if (index_exists($table, $index)) {
+ debugging('Index ' . $index->getName() . ' exists. Skipping its creation', DEBUG_DEVELOPER);
return true; //Index exists, nothing to do
}
return false;
}
-/// Check there is one index with the same fields
- if (!$indexexists = find_index_name($table, $index)) {
- /// TODO print some notify here (id debuglevel is DEVELOPER)
+/// Check index exists
+ if (!index_exists($table, $index)) {
+ debugging('Index ' . $index->getName() . ' do not exists. Skipping its deletion', DEBUG_DEVELOPER);
return true; //Index doesn't exist, nothing to do
}