function _image_update_7002_add_columns in Drupal 7
Add width and height columns to a specific table.
Parameters
$table: The name of the database table to be updated.
$columns: Keyed array of columns this table is supposed to have.
Related topics
1 call to _image_update_7002_add_columns()
- image_update_7002 in modules/
image/ image.install - Add width and height columns to image field schema and populate.
File
- modules/
image/ image.install, line 288 - Install, update and uninstall functions for the image module.
Code
function _image_update_7002_add_columns($table, $field_name) {
$spec = array(
'type' => 'int',
'unsigned' => TRUE,
);
$spec['description'] = 'The width of the image in pixels.';
db_add_field($table, $field_name . '_width', $spec);
$spec['description'] = 'The height of the image in pixels.';
db_add_field($table, $field_name . '_height', $spec);
}