From 7471f3f0dd0ebf1ffd9c337f055a4b14ae906ac1 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Sat, 30 Sep 2006 15:15:34 +0000 Subject: [PATCH] Adding some debugging() for some controlled actions. --- lib/ddllib.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/ddllib.php b/lib/ddllib.php index e5d7f3536e..5ae8dedfcc 100644 --- a/lib/ddllib.php +++ b/lib/ddllib.php @@ -705,7 +705,7 @@ function add_key($table, $key, $continue=true, $feedback=true) { 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; } @@ -739,7 +739,7 @@ function drop_key($table, $key, $continue=true, $feedback=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; } @@ -774,9 +774,9 @@ function add_index($table, $index, $continue=true, $feedback=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 } @@ -811,9 +811,9 @@ function drop_index($table, $index, $continue=true, $feedback=true) { 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 } -- 2.39.5