From: stronk7 Date: Sat, 30 Sep 2006 12:13:07 +0000 (+0000) Subject: Extendig use of new getTableName() over all generators X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=9af19c728df09dc463177f6b090e0294c78d186e;p=moodle.git Extendig use of new getTableName() over all generators --- diff --git a/lib/xmldb/classes/generators/mssql/mssql.class.php b/lib/xmldb/classes/generators/mssql/mssql.class.php index 5dc8bfce7d..912e622606 100644 --- a/lib/xmldb/classes/generators/mssql/mssql.class.php +++ b/lib/xmldb/classes/generators/mssql/mssql.class.php @@ -147,7 +147,7 @@ class XMLDBmssql extends XMLDBgenerator { $results = array(); /// Get the quoted name of the table and field - $tablename = $this->getEncQuoted($this->prefix . $xmldb_table->getName()); + $tablename = $this->getTableName($xmldb_table); $fieldname = $this->getEncQuoted($xmldb_field->getName()); $checkconsname = $this->getNameForObject($xmldb_table->getName(), $xmldb_field->getName(), 'ck'); @@ -180,7 +180,7 @@ class XMLDBmssql extends XMLDBgenerator { $results = array(); /// To store all the needed SQL commands /// Get the quoted name of the table and field - $tablename = $this->getEncQuoted($this->prefix . $xmldb_table->getName()); + $tablename = $this->getTableName($xmldb_table); $fieldname = $this->getEncQuoted($xmldb_field->getName()); /// Take a look to field metadata @@ -233,7 +233,7 @@ class XMLDBmssql extends XMLDBgenerator { $results = array(); /// Get the quoted name of the table and field - $tablename = $this->getEncQuoted($this->prefix . $xmldb_table->getName()); + $tablename = $this->getTableName($xmldb_table); $fieldname = $this->getEncQuoted($xmldb_field->getName()); /// Decide if we are going to create/modify or to drop the default @@ -260,7 +260,7 @@ class XMLDBmssql extends XMLDBgenerator { $results = array(); /// Get the quoted name of the table and field - $tablename = $this->getEncQuoted($this->prefix . $xmldb_table->getName()); + $tablename = $this->getTableName($xmldb_table); $fieldname = $this->getEncQuoted($xmldb_field->getName()); /// Now, check if, with the current field attributes, we have to build one default @@ -282,7 +282,7 @@ class XMLDBmssql extends XMLDBgenerator { $results = array(); /// Get the quoted name of the table and field - $tablename = $this->getEncQuoted($this->prefix . $xmldb_table->getName()); + $tablename = $this->getTableName($xmldb_table); $fieldname = $this->getEncQuoted($xmldb_field->getName()); /// Look for the default contraint and, if found, drop it @@ -303,7 +303,7 @@ class XMLDBmssql extends XMLDBgenerator { global $db; /// Get the quoted name of the table and field - $tablename = $this->getEncQuoted($this->prefix . $xmldb_table->getName()); + $tablename = $this->getTableName($xmldb_table); $fieldname = $this->getEncQuoted($xmldb_field->getName()); /// Look for any default constraint in this field and drop it diff --git a/lib/xmldb/classes/generators/mysql/mysql.class.php b/lib/xmldb/classes/generators/mysql/mysql.class.php index 89865a2358..fd052e0136 100644 --- a/lib/xmldb/classes/generators/mysql/mysql.class.php +++ b/lib/xmldb/classes/generators/mysql/mysql.class.php @@ -195,7 +195,7 @@ class XMLDBmysql extends XMLDBGenerator { $comment = ''; if ($xmldb_table->getComment()) { - $comment .= 'ALTER TABLE ' . $this->getEncQuoted($this->prefix . $xmldb_table->getName()); + $comment .= 'ALTER TABLE ' . $this->getTableName($xmldb_table); $comment .= " COMMENT='" . substr($xmldb_table->getComment(), 0, 250) . "'"; } return array($comment); diff --git a/lib/xmldb/classes/generators/oci8po/oci8po.class.php b/lib/xmldb/classes/generators/oci8po/oci8po.class.php index 5571f9b69b..0e74f031b4 100644 --- a/lib/xmldb/classes/generators/oci8po/oci8po.class.php +++ b/lib/xmldb/classes/generators/oci8po/oci8po.class.php @@ -140,7 +140,7 @@ class XMLDBoci8po extends XMLDBgenerator { $trigger = "CREATE TRIGGER " . $trigger_name; $trigger.= "\n BEFORE INSERT"; - $trigger.= "\nON " . $this->getEncQuoted($this->prefix . $xmldb_table->getName()); + $trigger.= "\nON " . $this->getTableName($xmldb_table); $trigger.= "\n FOR EACH ROW"; $trigger.= "\nBEGIN"; $trigger.= "\n IF :new." . $this->getEncQuoted($xmldb_field->getName()) . ' IS NULL THEN'; @@ -177,7 +177,7 @@ class XMLDBoci8po extends XMLDBgenerator { */ function getCommentSQL ($xmldb_table) { - $comment = "COMMENT ON TABLE " . $this->getEncQuoted($this->prefix . $xmldb_table->getName()); + $comment = "COMMENT ON TABLE " . $this->getTableName($xmldb_table); $comment.= " IS '" . substr($xmldb_table->getComment(), 0, 250) . "'"; return array($comment); @@ -205,7 +205,7 @@ class XMLDBoci8po extends XMLDBgenerator { $results = array(); /// To store all the needed SQL commands /// Get the quoted name of the table and field - $tablename = $this->getEncQuoted($this->prefix . $xmldb_table->getName()); + $tablename = $this->getTableName($xmldb_table); $fieldname = $this->getEncQuoted($xmldb_field->getName()); /// Take a look to field metadata diff --git a/lib/xmldb/classes/generators/postgres7/postgres7.class.php b/lib/xmldb/classes/generators/postgres7/postgres7.class.php index a06d2f6341..0e747b5240 100644 --- a/lib/xmldb/classes/generators/postgres7/postgres7.class.php +++ b/lib/xmldb/classes/generators/postgres7/postgres7.class.php @@ -124,7 +124,7 @@ class XMLDBpostgres7 extends XMLDBgenerator { */ function getCommentSQL ($xmldb_table) { - $comment = "COMMENT ON TABLE " . $this->getEncQuoted($this->prefix . $xmldb_table->getName()); + $comment = "COMMENT ON TABLE " . $this->getTableName($xmldb_table); $comment.= " IS '" . substr($xmldb_table->getComment(), 0, 250) . "'"; return array($comment); @@ -146,7 +146,7 @@ class XMLDBpostgres7 extends XMLDBgenerator { $results = array(); /// To store all the needed SQL commands /// Get the quoted name of the table and field - $tablename = $this->getEncQuoted($this->prefix . $xmldb_table->getName()); + $tablename = $this->getTableName($xmldb_table); $fieldname = $this->getEncQuoted($xmldb_field->getName()); /// Take a look to field metadata