You are here

function s3fs_schema in S3 File System 7.2

Same name and namespace in other branches
  1. 8.3 s3fs.install \s3fs_schema()
  2. 8.2 s3fs.install \s3fs_schema()
  3. 7.3 s3fs.install \s3fs_schema()
  4. 7 s3fs.install \s3fs_schema()
  5. 4.0.x s3fs.install \s3fs_schema()

Implements hook_schema().

2 calls to s3fs_schema()
s3fs_update_7202 in ./s3fs.install
Converts the `uri` column of the metadata table to BINARY.
_s3fs_refresh_cache in ./s3fs.module
Refreshes the metadata cache.

File

./s3fs.install, line 130
Install, update and uninstall functions for the S3 File System module.

Code

function s3fs_schema() {
  $schema = array();
  $schema['s3fs_file'] = array(
    'description' => 'Stores metadata about files in S3.',
    'fields' => array(
      'uri' => array(
        'description' => 'The S3 URI of the file.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'binary' => TRUE,
      ),
      'filesize' => array(
        'description' => 'The size of the file in bytes.',
        'type' => 'int',
        'size' => 'big',
        '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,
      ),
      'version' => array(
        'description' => 'The S3 VersionId of the object.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => FALSE,
        'default' => '',
      ),
    ),
    'primary key' => array(
      'uri',
    ),
  );
  return $schema;
}