You are here

function hosting_server_schema in Hosting 7.4

Same name and namespace in other branches
  1. 6.2 server/hosting_server.install \hosting_server_schema()
  2. 7.3 server/hosting_server.install \hosting_server_schema()

Implements hook_schema().

File

server/hosting_server.install, line 11
Define the database schema and update functions for the hosting_server module.

Code

function hosting_server_schema() {
  $schema['hosting_server'] = array(
    'fields' => array(
      'vid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'nid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'human_name' => array(
        'type' => 'text',
        'size' => 'small',
        'not null' => FALSE,
      ),
      'verified' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'status' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'vid',
    ),
  );
  $schema['hosting_ip_addresses'] = array(
    'fields' => array(
      'nid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'ip_address' => array(
        'type' => 'text',
        'size' => 'small',
        'not null' => TRUE,
      ),
      'id' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'id',
    ),
    'indexes' => array(
      'nid' => array(
        'nid',
      ),
    ),
  );
  $schema['hosting_service'] = array(
    'fields' => array(
      'vid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'nid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'service' => array(
        'type' => 'text',
        'size' => 'small',
        'not null' => TRUE,
      ),
      'type' => array(
        'type' => 'text',
        'size' => 'small',
        'not null' => TRUE,
      ),
      'restart_cmd' => array(
        'type' => 'text',
        'size' => 'big',
        'not null' => FALSE,
      ),
      'port' => array(
        'type' => 'int',
        'default' => 0,
        'unsigned' => TRUE,
        'not null' => FALSE,
      ),
      'available' => array(
        'type' => 'int',
        'size' => 'small',
        'not null' => TRUE,
        'default' => 1,
      ),
    ),
    'indexes' => array(
      'vid' => array(
        'vid',
      ),
    ),
  );
  return $schema;
}