You are here

function commerce_file_field_schema in Commerce File 7

Implements hook_field_schema().

File

./commerce_file.install, line 122
Install, update and uninstall functions this module.

Code

function commerce_file_field_schema($field) {
  if ($field['type'] == 'commerce_file') {
    return array(
      'columns' => array(
        'fid' => array(
          'description' => 'The {file_managed}.fid being referenced in this field.',
          'type' => 'int',
          'not null' => FALSE,
          'unsigned' => TRUE,
        ),
        'data' => array(
          'type' => 'blob',
          'size' => 'big',
          'not null' => FALSE,
          'serialize' => TRUE,
          'description' => 'Serialized data containing the license properties.',
        ),
      ),
      'indexes' => array(
        'fid' => array(
          'fid',
        ),
      ),
      'foreign keys' => array(
        'fid' => array(
          'table' => 'file_managed',
          'columns' => array(
            'fid' => 'fid',
          ),
        ),
      ),
    );
  }
}