summaryrefslogtreecommitdiff
path: root/update.php
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2006-06-19 06:12:08 +0000
committerDries Buytaert <dries@buytaert.net>2006-06-19 06:12:08 +0000
commit0147fa3b757f92ebdcf95321db6042554b4422b3 (patch)
treed1cbdee60c9b797ce9e0775d1096c73c2ccce5d8 /update.php
parent1a68f48c30cc02030d2a0e1035bb5b70c82b7816 (diff)
downloadbrdo-0147fa3b757f92ebdcf95321db6042554b4422b3.tar.gz
brdo-0147fa3b757f92ebdcf95321db6042554b4422b3.tar.bz2
- Patch #69659 by derek: improved documentation of db abstraction layer.
Diffstat (limited to 'update.php')
-rw-r--r--update.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/update.php b/update.php
index 8c74dead7..c28243c1a 100644
--- a/update.php
+++ b/update.php
@@ -28,9 +28,11 @@ function update_sql($sql) {
* Save result of SQL commands in $ret array.
*
* Note: when you add a column with NOT NULL and you are not sure if there are
- * already rows in the table, you MUST also add DEFAULT. Otherwise PostgreSQL won't
- * work when the table is not empty. If NOT NULL and DEFAULT are set the
- * PostgreSQL version will set values of the added column in old rows to the
+ * already rows in the table, you MUST also add DEFAULT. Otherwise PostgreSQL
+ * won't work when the table is not empty, and db_add_column() will fail.
+ * To have an empty string as the default, you must use: 'default' => "''"
+ * in the $attributes array. If NOT NULL and DEFAULT are set the PostgreSQL
+ * version will set values of the added column in old rows to the
* DEFAULT value.
*
* @param $ret
@@ -44,7 +46,7 @@ function update_sql($sql) {
* @param $attributes
* Additional optional attributes. Recognized attributes:
* not null => TRUE|FALSE
- * default => NULL|FALSE|value (with or without '', it won't be added)
+ * default => NULL|FALSE|value (the value must be enclosed in '' marks)
* @return
* nothing, but modifies $ret parameter.
*/