You are here

function formassembly_schema in FormAssembly 7

Implements hook_schema().

@fields: eid: internal entity id faid: external formsassembly id modified: unix timestamp

File

./formassembly.install, line 23
The Drupal .install file for the formassembly module

Code

function formassembly_schema() {
  $schema = array();
  $schema['formassembly'] = array(
    'description' => 'A table to hold forms synced from the FormAssembly service',
    'fields' => array(
      'eid' => array(
        'description' => 'Primary Key eid',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'faid' => array(
        'description' => 'Unique key assigned by FormAssembly to identify each form',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'name' => array(
        'description' => 'name as it is keyed by FormAssembly',
        'type' => 'text',
        'size' => 'normal',
        'not null' => FALSE,
      ),
      'modified' => array(
        'description' => 'Unix timestamp since the external data of the entity was last updated.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'eid',
    ),
    'unique keys' => array(
      'faid' => array(
        'faid',
      ),
    ),
    'indexes' => array(
      'form_id' => array(
        'faid',
      ),
      'changed' => array(
        'modified',
      ),
    ),
  );
  return $schema;
}