You are here

function webform_translation_schema in Webform Translation 7

Implements hook_schema().

File

./webform_translation.install, line 6

Code

function webform_translation_schema() {
  $schema = array();
  $schema['webform_component_translation'] = array(
    'description' => 'Table for storing webform component translations.',
    'fields' => array(
      'nid' => array(
        'description' => 'The node identifier of a webform.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'cid' => array(
        'description' => 'The identifier for this component within this node, starts at 0 for each node.',
        'type' => 'int',
        'size' => 'small',
        'unsigned' => FALSE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'language' => array(
        'type' => 'varchar',
        'length' => 12,
        'not null' => TRUE,
        'default' => '',
        'description' => "Language code, e.g. 'de' or 'en-US'.",
      ),
      'translations' => array(
        'description' => 'Serialized array with all translations.',
        'type' => 'text',
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'nid',
      'cid',
      'language',
    ),
  );
  return $schema;
}