]> git.mjollnir.org Git - moodle.git/commitdiff
PHP code for dropping and renaming tables added. Note that the DDL
authorstronk7 <stronk7>
Wed, 6 Sep 2006 22:34:09 +0000 (22:34 +0000)
committerstronk7 <stronk7>
Wed, 6 Sep 2006 22:34:09 +0000 (22:34 +0000)
functions doesn't exist yet. ;-)

admin/xmldb/actions/view_structure_php/view_structure_php.class.php

index b37adae5f3c0603ef75aba6804e07c1cd6e7f50b..74332175194167e16a1cbfe585bf34752698fe58 100644 (file)
@@ -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;