You are here

function video_cck_update_2 in Embedded Media Field 5

we need a new data field for extra info stored by certain providers, such as blip.tv

File

contrib/video_cck/video_cck.install, line 19

Code

function video_cck_update_2() {
  $ret = array();
  include_once './' . drupal_get_path('module', 'content') . '/content.module';
  include_once './' . drupal_get_path('module', 'content') . '/content_admin.inc';
  content_clear_type_cache();
  $fields = content_fields();
  foreach ($fields as $field) {
    switch ($field['type']) {
      case 'video_cck':
        $columns = array(
          'data' => array(
            'type' => 'longtext',
            'not null' => TRUE,
            'default' => "''",
            'sortable' => false,
          ),
        );

        // the following line will trigger (negligible) warnings if video_cck_update_2 was run before
        // (column already exists)
        @content_alter_db_field(array(), array(), $field, $columns);
        break;
    }
  }
  $ret = _video_cck_update_reset_cache();
  $ret[] = update_sql("DELETE FROM {cache}");
  return $ret;
}