Populate color field opacity in a specific table.

Parameters

string $table: The name of the database table to be updated.

string $field_name: Keyed array of columns this table is supposed to have.

1 call to _color_field_update_7000_populate_opacity()
color_field_update_7000 in ./color_field.install
Add opacity column to color field schema and populate with a default value of 1.

File

./color_field.install, line 132

Code

function _color_field_update_7000_populate_opacity($table, $field_name) {
    db_update($table)->fields(array(
        $field_name . '_opacity' => 1,
    ))
        ->isNull($field_name . '_opacity')
        ->execute();
}