You are here

function support_pm_schema in Support Ticketing System 7

Same name and namespace in other branches
  1. 6 support_pm/support_pm.install \support_pm_schema()

Support project management database schema definition.

File

support_pm/support_pm.install, line 11

Code

function support_pm_schema() {
  $schema['support_plan'] = array(
    'description' => 'Allows planning of hours required.',
    'fields' => array(
      'clid' => array(
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
      ),
      'uid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
      ),
      'day' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
      ),
      'hours' => array(
        'type' => 'float',
        'not null' => FALSE,
        'unsigned' => TRUE,
        'default' => 0.0,
      ),
      'comment' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
        'default' => '',
      ),
    ),
    'primary key' => array(
      'uid',
      'clid',
      'day',
    ),
  );
  $schema['support_project'] = array(
    'description' => 'Assign projects to support clients.',
    'fields' => array(
      'projid' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'unsigned' => TRUE,
      ),
      'project' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
        'default' => '',
      ),
      'path' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
        'default' => '',
      ),
      'disabled' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
      ),
      'weight' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => FALSE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'projid',
    ),
    'keys' => array(
      'project' => array(
        'project',
        'disabled',
        'weight',
      ),
    ),
    'unique keys' => array(
      'path' => array(
        'path',
      ),
    ),
  );
  $schema['support_project_client'] = array(
    'fields' => array(
      'projid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
      ),
      'clid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'projid',
      'clid',
    ),
  );
  $schema['support_project_ticket'] = array(
    'description' => 'Stores which projects are assigned to tickets.',
    'fields' => array(
      'nid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
      ),
      'projid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'nid',
      'projid',
    ),
  );
  return $schema;
}