You are here

function panels_update_7301 in Panels 7.3

Add lock field to panels_pane table.

File

./panels.install, line 457

Code

function panels_update_7301() {

  // Load the schema.
  // Due to a previous failure, the field may already exist:
  $schema = panels_schema_4();
  $table = 'panels_pane';
  $field = 'locks';
  if (!db_field_exists($table, $field)) {
    $spec = $schema[$table]['fields'][$field];

    // Core does not properly respect 'initial' and 'serialize'.
    unset($spec['initial']);

    // Re-define the column.
    db_add_field($table, $field, $spec);
    return t('Added panels_pane.lock field.');
  }
  return t('panels_pane.lock field already existed, update skipped.');
}