You are here

function media_update_7012 in D7 Media 7

Same name and namespace in other branches
  1. 7.4 media.install \media_update_7012()
  2. 7.2 media.install \media_update_7012()
  3. 7.3 media.install \media_update_7012()

Create the media_filter_usage table.

File

./media.install, line 465
Install, update and uninstall functions for the Media module.

Code

function media_update_7012() {
  $schema['media_filter_usage'] = array(
    'description' => 'Stores fids that have been included in the media tag in formatted textareas.',
    'fields' => array(
      'fid' => array(
        'description' => 'The media {file_managed}.fid.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'timestamp' => array(
        'description' => 'The timestamp the fid was last recorded by media_filter()',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'foreign keys' => array(
      'file_managed' => array(
        'table' => 'file_managed',
        'columns' => array(
          'fid' => 'fid',
        ),
      ),
    ),
    'primary key' => array(
      'fid',
    ),
    'indexes' => array(
      'timestamp' => array(
        'timestamp',
      ),
    ),
  );
  db_create_table('media_filter_usage', $schema['media_filter_usage']);
}