Implements hook_schema().

1 call to advagg_sri_schema()
advagg_sri_install dans advagg_sri/advagg_sri.install
Implements hook_install().

Fichier

advagg_sri/advagg_sri.install, line 44

Code

function advagg_sri_schema() {
    $schema = array();
    // Copy the variable table and change a couple of things.
    $schema['advagg_sri'] = drupal_get_schema_unprocessed('system', 'variable');
    // Create the filename field.
    $schema['advagg_sri']['fields']['filename'] = $schema['advagg_sri']['fields']['name'];
    $schema['advagg_sri']['fields']['filename']['length'] = 143;
    $schema['advagg_sri']['fields']['filename']['description'] = 'The name of the aggregate.';
    $schema['advagg_sri']['fields']['filename']['binary'] = TRUE;
    $schema['advagg_sri']['fields']['filename']['collation'] = 'ascii_bin';
    $schema['advagg_sri']['fields']['filename']['charset'] = 'ascii';
    $schema['advagg_sri']['fields']['filename']['mysql_character_set'] = 'ascii';
    // Create the hashes field.
    $schema['advagg_sri']['fields']['hashes'] = $schema['advagg_sri']['fields']['value'];
    $schema['advagg_sri']['fields']['hashes']['description'] = 'The hashes associated with this filename.';
    // Set primary key and table description.
    $schema['advagg_sri']['description'] = 'Stores sha hashes of this file.';
    $schema['advagg_sri']['primary key'][0] = 'filename';
    // Remove the name and value fileds.
    unset($schema['advagg_sri']['fields']['name'], $schema['advagg_sri']['fields']['value']);
    return $schema;
}