You are here

function color_field_update_7000 in Color Field 7.2

Add opacity column to color field schema and populate with a default value of 1.

File

./color_field.install, line 78
Install, update, and uninstall functions.

Code

function color_field_update_7000(array &$sandbox) {
  $fields = _update_7000_field_read_fields(array(
    'module' => 'color_field',
    'storage_type' => 'field_sql_storage',
    'deleted' => 0,
  ));
  foreach ($fields as $field) {
    $tables = array(
      _field_sql_storage_tablename($field),
      _field_sql_storage_revision_tablename($field),
    );
    foreach ($tables as $table) {

      // Add the opacity column to the table.
      _color_field_update_7000_add_opacity_column($table, $field['field_name']);
      _color_field_update_7000_populate_opacity($table, $field['field_name']);
    }
  }
}