You are here

function joomla_schema in Joomla to Drupal 7

Same name and namespace in other branches
  1. 6 joomla.install \joomla_schema()
  2. 7.2 joomla.install \joomla_schema()

Implementation of hook_schema().

File

./joomla.install, line 31

Code

function joomla_schema() {
  $schema['joomla_users'] = array(
    'description' => 'Stores the original Joomla user ID and password and links to the {users} table',
    'fields' => array(
      'uid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => "The users {users}.uid.",
      ),
      'juid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => "The users id from the Joomla database.",
      ),
      'password' => array(
        'type' => 'varchar',
        'length' => 100,
        'not null' => TRUE,
        'default' => '',
        'description' => "The users original Joomla password.",
      ),
      'converted' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => "Boolean value storing whether or not the users Joomla password has been converted to an entry in the {users}.pass table.",
      ),
    ),
    'primary key' => array(
      'uid',
    ),
    'unique keys' => array(
      'juid' => array(
        'juid',
      ),
    ),
  );
  $schema['joomla_sections'] = array(
    'description' => 'Stores the original Joomla section ID and links to the {vocabulary} table',
    'fields' => array(
      'vid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => "The {vocabulary}.vid.",
      ),
      'jsectionid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => "The section id from the Joomla database.",
      ),
    ),
    'primary key' => array(
      'vid',
    ),
    'unique keys' => array(
      'jsectionid' => array(
        'jsectionid',
      ),
    ),
  );
  $schema['joomla_categories'] = array(
    'description' => 'Stores the original Joomla category ID and links to the {term_data} table',
    'fields' => array(
      'jcategoryid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => "The category id from the Joomla database.",
      ),
      'jsectionid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => "The section id from the Joomla database.",
      ),
      'tid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => "The {term_data}.tid.",
      ),
    ),
    'primary key' => array(
      'jcategoryid',
    ),
  );
  $schema['joomla_content'] = array(
    'description' => 'Stores the original Joomla content ID links to the {node} table',
    'fields' => array(
      'nid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => "The {node}.nid.",
      ),
      'jcontentid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => "The content id from the Joomla database.",
      ),
    ),
    'primary key' => array(
      'nid',
    ),
    'unique keys' => array(
      'jcontentid' => array(
        'jcontentid',
      ),
    ),
  );
  return $schema;
}