- Patch #69659 by derek: improved documentation of db abstraction layer.
parent
1a68f48c30
commit
0147fa3b75
10
update.php
10
update.php
|
@ -28,9 +28,11 @@ function update_sql($sql) {
|
||||||
* Save result of SQL commands in $ret array.
|
* 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
|
* 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
|
* already rows in the table, you MUST also add DEFAULT. Otherwise PostgreSQL
|
||||||
* work when the table is not empty. If NOT NULL and DEFAULT are set the
|
* won't work when the table is not empty, and db_add_column() will fail.
|
||||||
* PostgreSQL version will set values of the added column in old rows to the
|
* 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.
|
* DEFAULT value.
|
||||||
*
|
*
|
||||||
* @param $ret
|
* @param $ret
|
||||||
|
@ -44,7 +46,7 @@ function update_sql($sql) {
|
||||||
* @param $attributes
|
* @param $attributes
|
||||||
* Additional optional attributes. Recognized attributes:
|
* Additional optional attributes. Recognized attributes:
|
||||||
* not null => TRUE|FALSE
|
* 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
|
* @return
|
||||||
* nothing, but modifies $ret parameter.
|
* nothing, but modifies $ret parameter.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue