- Patch #144765 by ChrisKennedy, drewish, bjaspan et al: schema fixes.
parent
1d7037a756
commit
633540ef8c
|
@ -209,7 +209,7 @@ function db_drop_table(&$ret, $table) {
|
||||||
* The field specification array, as taken from a schema definition
|
* The field specification array, as taken from a schema definition
|
||||||
*/
|
*/
|
||||||
function db_add_field(&$ret, $table, $field, $spec) {
|
function db_add_field(&$ret, $table, $field, $spec) {
|
||||||
$query = 'ALTER TABLE {'. $table .'} ADD '. $field .' ';
|
$query = 'ALTER TABLE {'. $table .'} ADD ';
|
||||||
$query .= _db_create_field_sql($field, _db_process_field($spec));
|
$query .= _db_create_field_sql($field, _db_process_field($spec));
|
||||||
$ret[] = update_sql($query);
|
$ret[] = update_sql($query);
|
||||||
}
|
}
|
||||||
|
@ -365,11 +365,6 @@ function db_drop_index(&$ret, $table, $name) {
|
||||||
/**
|
/**
|
||||||
* Change a field definition.
|
* Change a field definition.
|
||||||
*
|
*
|
||||||
* Remember that changing a field definition involves adding a new field
|
|
||||||
* and dropping an old one. This means that any indices, primary keys and
|
|
||||||
* sequences from serial-type fields are dropped and might need to be
|
|
||||||
* recreated.
|
|
||||||
*
|
|
||||||
* @param $ret
|
* @param $ret
|
||||||
* Array to which query results will be added.
|
* Array to which query results will be added.
|
||||||
* @param $table
|
* @param $table
|
||||||
|
|
|
@ -23,7 +23,7 @@ function menu_schema() {
|
||||||
'description' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
|
'description' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
|
||||||
'position' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
|
'position' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
|
||||||
'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
|
'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
|
||||||
'file' => array('type' => 'text', 'not null' => FALSE, 'default' => '', 'size' => 'medium')
|
'file' => array('type' => 'text', 'size' => 'medium')
|
||||||
),
|
),
|
||||||
'indexes' => array(
|
'indexes' => array(
|
||||||
'fit' => array('fit'),
|
'fit' => array('fit'),
|
||||||
|
|
Loading…
Reference in New Issue