summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Haug2009-03-23 16:48:43 (GMT)
committer Nathan Haug2009-03-23 16:48:43 (GMT)
commit6c32f1e12fe6e6eb2791fa0eefab67a461d5a294 (patch)
tree3df7089f40dab992df8c4755118e8ce409581db1
parent37011622377ff729c88917e76d09f98882f64ba8 (diff)
#409062: Fix column definitions.
-rw-r--r--filefield.install17
1 files changed, 15 insertions, 2 deletions
diff --git a/filefield.install b/filefield.install
index 8d3e190..198c098 100644
--- a/filefield.install
+++ b/filefield.install
@@ -100,10 +100,23 @@ function filefield_update_6001() {
}
}
- // Add data column to FileFields.
+ // Update database storage (add data column, remove description, set NOT NULL).
foreach ($fields as $field) {
$new_field = $field;
- $new_field['columns']['data'] = array('type' => 'text');
+
+ // Setup the previous definition.
+ $field['columns']['description'] = array('type' => 'varchar');
+ $field['columns']['fid']['not null'] = TRUE;
+ $field['columns']['list']['not null'] = TRUE;
+ unset($field['columns']['data']);
+
+ // Setup the new definition.
+ $new_field['columns']['data'] = array('type' => 'text', 'serialize' => TRUE);
+ $new_field['columns']['fid']['not null'] = FALSE;
+ $new_field['columns']['list']['size'] = 'tiny';
+ $new_field['columns']['list']['not null'] = FALSE;
+ unset($new_field['columns']['description']);
+
content_alter_db($field, $new_field);
}