mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
PHP code for dropping and renaming tables added. Note that the DDL
functions doesn't exist yet. ;-)
This commit is contained in:
parent
3ab430fbc5
commit
386c23c9da
1 changed files with 16 additions and 0 deletions
|
@ -242,6 +242,14 @@ class view_structure_php extends XMLDBAction {
|
|||
$result .= XMLDB_PHP_HEADER;
|
||||
|
||||
/// Add contents
|
||||
$result .= XMLDB_LINEFEED;
|
||||
$result .= ' /// Create table ' . $table->getName() . XMLDB_LINEFEED;
|
||||
$result .= ' $table = new XMLDBTable(' . "'" . $table->getName() . "'" . ');' . XMLDB_LINEFEED;
|
||||
|
||||
/// Launch the proper DDL
|
||||
$result .= XMLDB_LINEFEED;
|
||||
$result .= ' /// Launch drop table for ' . $table->getName() . XMLDB_LINEFEED;
|
||||
$result .= ' $status = $status && drop_table($table);' . XMLDB_LINEFEED;
|
||||
|
||||
/// Add standard PHP footer
|
||||
$result .= XMLDB_PHP_FOOTER;
|
||||
|
@ -272,6 +280,14 @@ class view_structure_php extends XMLDBAction {
|
|||
$result .= XMLDB_PHP_HEADER;
|
||||
|
||||
/// Add contents
|
||||
$result .= XMLDB_LINEFEED;
|
||||
$result .= ' /// Create table ' . $table->getName() . XMLDB_LINEFEED;
|
||||
$result .= ' $table = new XMLDBTable(' . "'" . $table->getName() . "'" . ');' . XMLDB_LINEFEED;
|
||||
|
||||
/// Launch the proper DDL
|
||||
$result .= XMLDB_LINEFEED;
|
||||
$result .= ' /// Launch rename table for ' . $table->getName() . XMLDB_LINEFEED;
|
||||
$result .= ' $status = $status && rename_table($table, ' . "'NEWNAMEGOESHERE'" . ');' . XMLDB_LINEFEED;
|
||||
|
||||
/// Add standard PHP footer
|
||||
$result .= XMLDB_PHP_FOOTER;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue