You are here

function l10n_update_schema in Localization update 6

Same name and namespace in other branches
  1. 7.2 l10n_update.install \l10n_update_schema()
  2. 7 l10n_update.install \l10n_update_schema()

Implementation of hook_schema().

File

./l10n_update.install, line 11
Install file for l10n remote updates.

Code

function l10n_update_schema() {
  $schema['l10n_update_project'] = array(
    'description' => 'Update information for project translations.',
    'fields' => array(
      'name' => array(
        'description' => 'A unique short name to identify the project.',
        'type' => 'varchar',
        'length' => '50',
        'not null' => TRUE,
      ),
      'project_type' => array(
        'description' => 'Project type, may be core, module, theme',
        'type' => 'varchar',
        'length' => '50',
        'not null' => TRUE,
      ),
      'core' => array(
        'description' => 'Core compatibility string for this project.',
        'type' => 'varchar',
        'length' => '128',
        'not null' => TRUE,
        'default' => '',
      ),
      'version' => array(
        'description' => 'Human readable name for project used on the interface.',
        'type' => 'varchar',
        'length' => '128',
        'not null' => TRUE,
        'default' => '',
      ),
      'l10n_server' => array(
        'description' => 'Localization server for this project.',
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
      ),
      'l10n_path' => array(
        'description' => 'Server path this project updates.',
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
      ),
      'status' => array(
        'description' => 'Status flag. TBD',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 1,
      ),
    ),
    'primary key' => array(
      'name',
    ),
  );
  $schema['l10n_update_file'] = array(
    'description' => 'File and download information for project translations.',
    'fields' => array(
      'project' => array(
        'description' => 'A unique short name to identify the project.',
        'type' => 'varchar',
        'length' => '50',
        'not null' => TRUE,
      ),
      'language' => array(
        'description' => 'Reference to the {languages}.language for this translation.',
        'type' => 'varchar',
        'length' => '12',
        'not null' => TRUE,
      ),
      'type' => array(
        'description' => 'File origin: download or localfile',
        'type' => 'varchar',
        'length' => '50',
        'not null' => TRUE,
        'default' => '',
      ),
      'filename' => array(
        'description' => 'Link to translation file for download.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'fileurl' => array(
        'description' => 'Link to translation file for download.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'filepath' => array(
        'description' => 'File system path for importing the file.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'timestamp' => array(
        'description' => 'Unix timestamp of the time the file was downloaded or saved to disk. Zero if not yet downloaded.',
        'type' => 'int',
        'not null' => FALSE,
        'disp-width' => '11',
        'default' => 0,
      ),
      'version' => array(
        'description' => 'Version tag of the downloaded file.',
        'type' => 'varchar',
        'length' => '128',
        'not null' => TRUE,
        'default' => '',
      ),
      'status' => array(
        'description' => 'Status flag. TBD',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 1,
      ),
      'last_checked' => array(
        'description' => 'Unix timestamp of the last time this translation was downloaded from or checked at remote server and confirmed to be the most recent release available.',
        'type' => 'int',
        'not null' => FALSE,
        'disp-width' => '11',
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'project',
      'language',
    ),
  );
  $schema['cache_l10n_update'] = drupal_get_schema_unprocessed('system', 'cache');
  $schema['cache_l10n_update']['description'] = 'Cache table for the Localization Update module to store information about available releases, fetched from central server.';
  return $schema;
}