]> git.mjollnir.org Git - moodle.git/commitdiff
During the conversion datalib -> ddllib, Eloy removed my comment that made it possibl...
authortjhunt <tjhunt>
Thu, 24 Aug 2006 15:37:03 +0000 (15:37 +0000)
committertjhunt <tjhunt>
Thu, 24 Aug 2006 15:37:03 +0000 (15:37 +0000)
lib/ddllib.php

index 67f4ee313e65ad815fb5a41436a66dae1598bff6..738439cfa4b32e1b266b0face328ab3bed9451e5 100644 (file)
     require_once($CFG->libdir . '/xmlize.php');
     
 
+/**
+ * Add a new field to a table, or modify an existing one (if oldfield is defined).
+ * Warning: Please be careful on primary keys, as this function will eat auto_increments
+ *
+ * @uses $CFG
+ * @uses $db
+ * @param string $table the name of the table to modify. (Without the prefix.)
+ * @param string $oldfield If changing an existing column, the name of that column.
+ * @param string $field The name of the column at the end of the operation.
+ * @param string $type The type of the column at the end of the operation. TEXT, VARCHAR, CHAR, INTEGER, REAL, or TINYINT
+ * @param string $size The size of that column type. As in VARCHAR($size), or INTEGER($size).
+ * @param string $signed For numeric column types, whether that column is 'signed' or 'unsigned'.
+ * @param string $default The new default value for the column.
+ * @param string $null 'not null', or '' to allow nulls.
+ * @param string $after Which column to insert this one after. Not supported on Postgres.
+ *
+ * @return boolean Wheter the operation succeeded.
+ */
 function table_column($table, $oldfield, $field, $type='integer', $size='10',
                       $signed='unsigned', $default='0', $null='not null', $after='') {
     global $CFG, $db, $empty_rs_cache;