You are here

function hosting_package_schema in Hosting 7.4

Same name and namespace in other branches
  1. 6.2 package/hosting_package.install \hosting_package_schema()
  2. 7.3 package/hosting_package.install \hosting_package_schema()

Implements hook_schema().

File

package/hosting_package.install, line 10
Define database schema and update functions for the package management module.

Code

function hosting_package_schema() {
  $schema['hosting_package'] = array(
    'fields' => array(
      'vid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'nid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'package_type' => array(
        'type' => 'varchar',
        'length' => 16,
        'not null' => TRUE,
        'default' => '',
      ),
      'short_name' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'old_short_name' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'description' => array(
        'type' => 'text',
        'size' => 'big',
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'vid',
    ),
    'indexes' => array(
      'hosting_package_nid_idx' => array(
        'nid',
      ),
    ),
  );
  $schema['hosting_package_instance'] = array(
    'fields' => array(
      'iid' => array(
        'type' => 'serial',
        'not null' => TRUE,
      ),
      'rid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'package_id' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'filename' => array(
        'type' => 'text',
        'size' => 'normal',
        'not null' => TRUE,
      ),
      'schema_version' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'version' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'version_code' => array(
        'type' => 'int',
        'size' => 'big',
        'not null' => TRUE,
        'default' => 0,
      ),
      'status' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'platform' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'iid',
    ),
    'indexes' => array(
      'hosting_package_rid_idx' => array(
        'rid',
      ),
      'hosting_package_id_idx' => array(
        'package_id',
      ),
    ),
  );
  $schema['hosting_package_languages'] = array(
    'fields' => array(
      'iid' => array(
        'type' => 'int',
        'not null' => TRUE,
      ),
      'language' => array(
        'type' => 'varchar',
        'length' => 12,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
  );
  return $schema;
}