]> git.mjollnir.org Git - moodle.git/commitdiff
Extendig use of new getTableName() over all generators
authorstronk7 <stronk7>
Sat, 30 Sep 2006 12:13:07 +0000 (12:13 +0000)
committerstronk7 <stronk7>
Sat, 30 Sep 2006 12:13:07 +0000 (12:13 +0000)
lib/xmldb/classes/generators/mssql/mssql.class.php
lib/xmldb/classes/generators/mysql/mysql.class.php
lib/xmldb/classes/generators/oci8po/oci8po.class.php
lib/xmldb/classes/generators/postgres7/postgres7.class.php

index 5dc8bfce7dc40c815879df2a60492bbe4e33a9ee..912e62260633a672d78fbc88c7f5ea0217ae7b98 100644 (file)
@@ -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
index 89865a2358c716ec40455b6f7cb38d39702b04b8..fd052e01365d58dba79c9bb58630c490e177b0ff 100644 (file)
@@ -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);
index 5571f9b69b2167067b8e435df257df4c62786d63..0e74f031b42b5a72ac73df9e86ee508f8f72acba 100644 (file)
@@ -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
index a06d2f6341ed89c22edff8cf91f6e747b7ba6ab8..0e747b5240bb9ef37a4982bc198e56cf9bb066f9 100644 (file)
@@ -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