mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Initial commit of rename_table(). Not ended!
This commit is contained in:
parent
8ad2207965
commit
a59f3a34f3
4 changed files with 86 additions and 15 deletions
|
@ -91,6 +91,7 @@ class XMLDBgenerator {
|
|||
|
||||
var $concat_character = '||'; //Characters to be used as concatenation operator. If not defined
|
||||
//MySQL CONCAT function will be used
|
||||
|
||||
var $rename_table_sql = 'ALTER TABLE OLDNAME RENAME TO NEWNAME'; //SQL sentence to rename one table, both
|
||||
//OLDNAME and NEWNAME are dinamically replaced
|
||||
|
||||
|
@ -471,9 +472,6 @@ class XMLDBgenerator {
|
|||
|
||||
$newt = new XMLDBTable($newname); //Temporal table for name calculations
|
||||
|
||||
$oldtablename = $this->getTableName($xmldb_table);
|
||||
$newtablename = $this->getTableName($newt);
|
||||
|
||||
$rename = str_replace('OLDNAME', $this->getTableName($xmldb_table), $this->rename_table_sql);
|
||||
$rename = str_replace('NEWNAME', $this->getTableName($newt), $rename);
|
||||
|
||||
|
|
|
@ -53,6 +53,9 @@ class XMLDBmssql extends XMLDBgenerator {
|
|||
var $concat_character = '+'; //Characters to be used as concatenation operator. If not defined
|
||||
//MySQL CONCAT function will be use
|
||||
|
||||
var $rename_table_sql = "sp_rename 'OLDNAME', 'NEWNAME'"; //SQL sentence to rename one table, both
|
||||
//OLDNAME and NEWNAME are dinamically replaced
|
||||
|
||||
var $drop_index_sql = 'DROP INDEX TABLENAME.INDEXNAME'; //SQL sentence to drop one index
|
||||
//TABLENAME, INDEXNAME are dinamically replaced
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue