field_completeness-1.0.3/field_completeness.install
field_completeness.install
<?php
/**
* @file
* Field Completeness - Provides field-based completeness for any entity - install.
*/
/**
* Implements hook_schema().
*/
function field_completeness_schema() {
return array(
'field_completeness' => array(
'description' => 'Stores the completeness of entities.',
'fields' => array(
'entity_type' => array(
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
'description' => 'The entity type this field complete data is attached to.',
),
'entity_id' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'The entity id this data is attached to.',
),
'langcode' => array(
'type' => 'varchar',
'length' => 128,
'not null' => FALSE,
'default' => '',
'description' => 'The entity type this field complete data is attached to.',
),
'revision_id' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => FALSE,
'description' => 'The entity revision id this data is attached to, or NULL if the entity type is not versioned.',
),
'complete' => array(
'type' => 'int',
'size' => 'tiny',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 1,
'description' => 'The completeness of this entity as a boolean, true or false.',
),
'percentage' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 100,
'description' => 'The completeness of this entity as a percentage scale from 0 to 100.',
),
'completeness' => array(
'type' => 'blob',
'size' => 'big',
'not null' => FALSE,
'serialize' => TRUE,
'description' => 'The individual completeness of the fields of this entity.',
),
),
'primary key' => array('entity_type', 'entity_id'),
'indexes' => array(
'entity_type' => array('entity_type'),
'entity_id' => array('entity_id'),
'revision_id' => array('revision_id'),
'complete' => array('complete'),
'percentage' => array('percentage'),
),
),
);
}