Skip to content

Commit

Permalink
PHP code for dropping and renaming tables added. Note that the DDL
Browse files Browse the repository at this point in the history
functions doesn't exist yet. ;-)
  • Loading branch information
stronk7 committed Sep 6, 2006
1 parent 3ab430f commit 386c23c
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,14 @@ function drop_table_php($structure, $table) {
$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;
Expand Down Expand Up @@ -272,6 +280,14 @@ function rename_table_php($structure, $table) {
$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;
Expand Down

0 comments on commit 386c23c

Please sign in to comment.