You are here

function amazons3_schema in AmazonS3 7

Same name and namespace in other branches
  1. 7.2 amazons3.install \amazons3_schema()

Implements hook_schema().

File

./amazons3.install, line 65
Install, update and uninstall functions for the AmazonS3 module.

Code

function amazons3_schema() {
  $schema['amazons3_file'] = array(
    'description' => 'Stores information for uploaded Amazon S3 files.',
    'fields' => array(
      'uri' => array(
        'description' => 'The URI to access the file (either local or remote).',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'filesize' => array(
        'description' => 'The size of the file in bytes.',
        'type' => 'int',
        'size' => 'big',
        'length' => 14,
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'timestamp' => array(
        'description' => 'UNIX timestamp for when the file was added.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'dir' => array(
        'description' => 'Boolean indicating whether or not this object is a directory.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'mode' => array(
        'description' => 'The file mode returned by the stat function.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'uid' => array(
        'description' => 'The uid of the user who is associated with the file (not Drupal uid).',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'indexes' => array(
      'timestamp' => array(
        'timestamp',
      ),
    ),
    'primary key' => array(
      'uri',
    ),
  );
  return $schema;
}