You are here

function resource_schema in D7 Media 6

File

resource/resource.install, line 39

Code

function resource_schema() {
  $schema['resource'] = array(
    'description' => t('Stores information for Resources.'),
    'fields' => array(
      'rid' => array(
        'description' => t('Primary Key: Unique Resource ID.'),
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'uid' => array(
        'description' => t('The {users}.uid of the user who is associated with the resource.'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'name' => array(
        'description' => t('Name of the resource.'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'url' => array(
        'description' => t('URL of the resource.'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'mimetype' => array(
        'description' => t('The resource MIME type.'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'size' => array(
        'description' => t('The size of the resource in bytes.'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'status' => array(
        'description' => t('A flag indicating whether file is temporary (0) or permanent (1).'),
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'timestamp' => array(
        'description' => t('UNIX timestamp for when the file was added.'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'indexes' => array(
      'uid' => array(
        'uid',
      ),
      'status' => array(
        'status',
      ),
      'timestamp' => array(
        'timestamp',
      ),
    ),
    'primary key' => array(
      'rid',
    ),
  );
  return $schema;
}