You are here

function mediafront_schema in MediaFront 7

Same name and namespace in other branches
  1. 6.2 mediafront.install \mediafront_schema()
  2. 6 mediafront.install \mediafront_schema()
  3. 7.2 mediafront.install \mediafront_schema()

Implements hook_schema().

File

./mediafront.install, line 5

Code

function mediafront_schema() {
  $schema['mediafront_preset'] = array(
    'description' => 'The preset table for MediaFront.',
    'fields' => array(
      'pid' => array(
        'description' => 'The primary identifier for a MediaFront preset.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'name' => array(
        'description' => 'The name of this preset.',
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
      ),
      'description' => array(
        'description' => 'A brief description of this preset.',
        'type' => 'text',
        'size' => 'medium',
        'translatable' => TRUE,
      ),
      'player' => array(
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
      ),
      'connect' => array(
        'type' => 'text',
        'size' => 'medium',
        'serialize' => TRUE,
        'description' => 'Serialized player connection settings.',
      ),
      'settings' => array(
        'type' => 'text',
        'size' => 'medium',
        'serialize' => TRUE,
        'description' => 'Serialized player settings that do not warrant a dedicated column.',
      ),
    ),
    'unique keys' => array(
      'name' => array(
        'name',
      ),
    ),
    'primary key' => array(
      'pid',
    ),
  );
  $schema['mediafront_filefield'] = array(
    'description' => 'Table used to tell the MediaFront module how each FileField should be handled.',
    'fields' => array(
      'fid' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'entity' => array(
        'type' => 'text',
        'not null' => FALSE,
      ),
      'bundle' => array(
        'type' => 'text',
        'not null' => FALSE,
      ),
      'field_name' => array(
        'type' => 'text',
        'not null' => FALSE,
      ),
      'media_type' => array(
        'type' => 'text',
        'not null' => FALSE,
      ),
      'node_preset' => array(
        'type' => 'text',
        'not null' => FALSE,
      ),
      'thumb_preset' => array(
        'type' => 'text',
        'not null' => FALSE,
      ),
    ),
    'primary key' => array(
      'fid',
    ),
  );
  return $schema;
}