You are here

function makemeeting_update_7201 in Make Meeting Scheduler 7.2

Add yesnomaybe column to field tables

File

./makemeeting.install, line 141
Makemeeting installation schemas

Code

function makemeeting_update_7201() {
  $results = db_select('field_config', 'fc')
    ->fields('fc')
    ->condition('type', 'makemeeting')
    ->execute()
    ->fetchAll();
  foreach ($results as $field) {
    foreach (array(
      'data',
      'revision',
    ) as $type) {
      $table = "field_{$type}_{$field->field_name}";
      $column = "{$field->field_name}_yesnomaybe";

      // Data and revision tables need to be fixed
      if (!db_field_exists($table, $column)) {
        db_add_field($table, $column, array(
          'type' => 'int',
          'length' => 1,
          'not null' => FALSE,
          'default' => 0,
        ));
      }
    }
  }
}