mirror of
https://github.com/moodle/moodle.git
synced 2025-05-04 07:08:51 +02:00
add_key() and drop_key() are working (with sync of undelying
indexes automated)
This commit is contained in:
parent
0852990f9b
commit
fac17f427f
@ -909,6 +909,42 @@ class XMLDBTable extends XMLDBObject {
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will return the SQL code needed to add one key to the table for the specified DB and
|
||||
* prefix. Just one simple wrapper over generators.
|
||||
*/
|
||||
function getAddKeySQL ($dbtype, $prefix, $xmldb_key, $statement_end=true) {
|
||||
|
||||
$results = array();
|
||||
|
||||
$classname = 'XMLDB' . $dbtype;
|
||||
$generator = new $classname();
|
||||
$generator->setPrefix($prefix);
|
||||
$results = $generator->getAddKeySQL($this, $xmldb_key);
|
||||
if ($statement_end) {
|
||||
$results = $generator->getEndedStatements($results);
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will return the SQL code needed to drop one key from the table for the specified DB and
|
||||
* prefix. Just one simple wrapper over generators.
|
||||
*/
|
||||
function getDropKeySQL ($dbtype, $prefix, $xmldb_key, $statement_end=true) {
|
||||
|
||||
$results = array();
|
||||
|
||||
$classname = 'XMLDB' . $dbtype;
|
||||
$generator = new $classname();
|
||||
$generator->setPrefix($prefix);
|
||||
$results = $generator->getDropKeySQL($this, $xmldb_key);
|
||||
if ($statement_end) {
|
||||
$results = $generator->getEndedStatements($results);
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will return the SQL code needed to add one index to the table for the specified DB and
|
||||
* prefix. Just one simple wrapper over generators.
|
||||
|
Loading…
x
Reference in New Issue
Block a user