You are here

function i18n_string_schema in Internationalization 7

Implements hook_schema().

File

i18n_string/i18n_string.install, line 50
Installation file for i18n_string module.

Code

function i18n_string_schema() {
  $schema['i18n_string'] = array(
    'description' => 'Metadata for source strings.',
    'fields' => array(
      'lid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Source string ID. References {locales_source}.lid.',
      ),
      'textgroup' => array(
        'type' => 'varchar',
        'length' => 50,
        'not null' => TRUE,
        'default' => 'default',
        'description' => 'A module defined group of translations, see hook_locale().',
      ),
      'context' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => 'Full string ID for quick search: type:objectid:property.',
      ),
      'objectid' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => 'Object ID.',
      ),
      'type' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => 'Object type for this string.',
      ),
      'property' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => 'Object property for this string.',
      ),
      'objectindex' => array(
        'type' => 'int',
        'size' => 'big',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Integer value of Object ID.',
      ),
      'format' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
        'description' => 'The {filter_format}.format of the string.',
      ),
    ),
    'primary key' => array(
      'lid',
    ),
    'indexes' => array(
      'group_context' => array(
        'textgroup',
        array(
          'context',
          50,
        ),
      ),
    ),
  );
  return $schema;
}