Skip to content
Snippets Groups Projects
Commit e21b5be8 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #45747 by Cvbge: documentation improvement + added primary key that got lost

parent b6b98bb6
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -1424,6 +1424,7 @@ function system_update_167() {
break;
case 'pgsql':
db_change_column($ret, 'vocabulary_node_types', 'type', 'type', 'varchar(32)', array('not null' => TRUE, 'default' => "''"));
$ret[] = update_sql("ALTER TABLE {vocabulary_node_types} ADD PRIMARY KEY (vid, type)");
break;
}
......
......@@ -78,6 +78,11 @@ function db_add_column(&$ret, $table, $column, $type, $attributes = array()) {
* Changes a column definition. Uses syntax appropriate for PostgreSQL.
* Saves result of SQL commands in $ret array.
*
* Please remember, that changing column definition involves adding new column
* and dropping old one. This means that any indexes, primary keys and
* sequences from the serial-type columns are dropped and might need to be
* recreated.
*
* @param $ret
* Array to which results will be added.
* @param $table
......@@ -91,7 +96,7 @@ function db_add_column(&$ret, $table, $column, $type, $attributes = array()) {
* @param $attributes
* Additional optional attributes. Recognized atributes:
* - not null => TRUE/FALSE
* - default => NULL/FALSE/value (with or without '', it wont' be added)
* - default => NULL/FALSE/value (with or without '', it won't be added)
* @return
* nothing, but modifies $ret parametr.
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment