Extendig use of new getTableName() over all generators

This commit is contained in:
stronk7 2006-09-30 12:13:07 +00:00
parent 97b9178459
commit 9af19c728d
4 changed files with 12 additions and 12 deletions

View file

@ -147,7 +147,7 @@ class XMLDBmssql extends XMLDBgenerator {
$results = array(); $results = array();
/// Get the quoted name of the table and field /// 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()); $fieldname = $this->getEncQuoted($xmldb_field->getName());
$checkconsname = $this->getNameForObject($xmldb_table->getName(), $xmldb_field->getName(), 'ck'); $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 $results = array(); /// To store all the needed SQL commands
/// Get the quoted name of the table and field /// 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()); $fieldname = $this->getEncQuoted($xmldb_field->getName());
/// Take a look to field metadata /// Take a look to field metadata
@ -233,7 +233,7 @@ class XMLDBmssql extends XMLDBgenerator {
$results = array(); $results = array();
/// Get the quoted name of the table and field /// 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()); $fieldname = $this->getEncQuoted($xmldb_field->getName());
/// Decide if we are going to create/modify or to drop the default /// Decide if we are going to create/modify or to drop the default
@ -260,7 +260,7 @@ class XMLDBmssql extends XMLDBgenerator {
$results = array(); $results = array();
/// Get the quoted name of the table and field /// 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()); $fieldname = $this->getEncQuoted($xmldb_field->getName());
/// Now, check if, with the current field attributes, we have to build one default /// Now, check if, with the current field attributes, we have to build one default
@ -282,7 +282,7 @@ class XMLDBmssql extends XMLDBgenerator {
$results = array(); $results = array();
/// Get the quoted name of the table and field /// 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()); $fieldname = $this->getEncQuoted($xmldb_field->getName());
/// Look for the default contraint and, if found, drop it /// Look for the default contraint and, if found, drop it
@ -303,7 +303,7 @@ class XMLDBmssql extends XMLDBgenerator {
global $db; global $db;
/// Get the quoted name of the table and field /// 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()); $fieldname = $this->getEncQuoted($xmldb_field->getName());
/// Look for any default constraint in this field and drop it /// Look for any default constraint in this field and drop it

View file

@ -195,7 +195,7 @@ class XMLDBmysql extends XMLDBGenerator {
$comment = ''; $comment = '';
if ($xmldb_table->getComment()) { 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) . "'"; $comment .= " COMMENT='" . substr($xmldb_table->getComment(), 0, 250) . "'";
} }
return array($comment); return array($comment);

View file

@ -140,7 +140,7 @@ class XMLDBoci8po extends XMLDBgenerator {
$trigger = "CREATE TRIGGER " . $trigger_name; $trigger = "CREATE TRIGGER " . $trigger_name;
$trigger.= "\n BEFORE INSERT"; $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.= "\n FOR EACH ROW";
$trigger.= "\nBEGIN"; $trigger.= "\nBEGIN";
$trigger.= "\n IF :new." . $this->getEncQuoted($xmldb_field->getName()) . ' IS NULL THEN'; $trigger.= "\n IF :new." . $this->getEncQuoted($xmldb_field->getName()) . ' IS NULL THEN';
@ -177,7 +177,7 @@ class XMLDBoci8po extends XMLDBgenerator {
*/ */
function getCommentSQL ($xmldb_table) { 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) . "'"; $comment.= " IS '" . substr($xmldb_table->getComment(), 0, 250) . "'";
return array($comment); return array($comment);
@ -205,7 +205,7 @@ class XMLDBoci8po extends XMLDBgenerator {
$results = array(); /// To store all the needed SQL commands $results = array(); /// To store all the needed SQL commands
/// Get the quoted name of the table and field /// 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()); $fieldname = $this->getEncQuoted($xmldb_field->getName());
/// Take a look to field metadata /// Take a look to field metadata

View file

@ -124,7 +124,7 @@ class XMLDBpostgres7 extends XMLDBgenerator {
*/ */
function getCommentSQL ($xmldb_table) { 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) . "'"; $comment.= " IS '" . substr($xmldb_table->getComment(), 0, 250) . "'";
return array($comment); return array($comment);
@ -146,7 +146,7 @@ class XMLDBpostgres7 extends XMLDBgenerator {
$results = array(); /// To store all the needed SQL commands $results = array(); /// To store all the needed SQL commands
/// Get the quoted name of the table and field /// 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()); $fieldname = $this->getEncQuoted($xmldb_field->getName());
/// Take a look to field metadata /// Take a look to field metadata