You are here

function bynder_update_7101 in Bynder 7

Adding Bynder Media Usage table if not existing.

File

./bynder.install, line 151
Install, update and uninstall functions for the Media: Bynder module.

Code

function bynder_update_7101() {
  if (!db_table_exists('bynder_media_usage')) {
    $schema['bynder_media_usage'] = array(
      'description' => 'Associates stored Bynder assets with file and node ids.',
      'fields' => array(
        'id' => array(
          'type' => 'serial',
          'unsigned' => true,
          'not null' => true,
        ),
        'bynder_entity_id' => array(
          'description' => 'Bynder Drupal Entity identifier.',
          'type' => 'varchar',
          'length' => 255,
          'not null' => true,
          'default' => '',
        ),
        'bynder_id' => array(
          'description' => 'Bynder asset unique identifier.',
          'type' => 'varchar',
          'length' => 255,
          'not null' => true,
          'default' => '',
        ),
        'fid' => array(
          'description' => 'Drupal file identifier.',
          'type' => 'varchar',
          'length' => 255,
          'not null' => true,
          'default' => '',
        ),
        'nid' => array(
          'description' => 'The node identifier.',
          'type' => 'varchar',
          'length' => 255,
          'not null' => true,
          'default' => '',
        ),
      ),
      'primary key' => array(
        'id',
      ),
    );
    db_create_table('bynder_media_usage', $schema['bynder_media_usage']);
  }
}