function brightcove_field_update_7201 in Brightcove Video Connect 7.3
Same name and namespace in other branches
- 7.2 brightcove_field/brightcove_field.install \brightcove_field_update_7201()
- 7.4 brightcove_field/brightcove_field.install \brightcove_field_update_7201()
- 7.5 brightcove_field/brightcove_field.install \brightcove_field_update_7201()
Updates the schema of the brightcove field if possible.
File
- brightcove_field/
brightcove_field.install, line 33 - Schema and update funciton for the module.
Code
function brightcove_field_update_7201() {
if (module_exists('field_sql_storage')) {
$coldef = array(
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
);
foreach (field_info_fields() as $name => $def) {
if ($def['type'] == 'brightcove_field' && $def['storage']['type'] == 'field_sql_storage') {
$tablename = _field_sql_storage_tablename($def);
$revtablename = _field_sql_storage_revision_tablename($def);
$playercol = _field_sql_storage_columnname($name, 'player');
db_add_field($tablename, $playercol, $coldef);
db_add_field($revtablename, $playercol, $coldef);
}
}
db_delete('cache_field')
->execute();
}
}