mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Extendig use of new getTableName() over all generators
This commit is contained in:
parent
97b9178459
commit
9af19c728d
4 changed files with 12 additions and 12 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue