You are here

function pminvoice_schema in Drupal PM (Project Management) 7

Implements hook_schema().

File

pminvoice/pminvoice.install, line 151
Installation functions for PM Invoice.

Code

function pminvoice_schema() {
  $schema['pminvoice'] = array(
    'fields' => array(
      'vid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'nid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'number' => array(
        'type' => 'varchar',
        'length' => 50,
      ),
      'reference' => array(
        'type' => 'varchar',
        'length' => 150,
      ),
      'organization_nid' => array(
        'type' => 'int',
      ),
      'organization_title' => array(
        'type' => 'varchar',
        'length' => 128,
      ),
      'project_nid' => array(
        'type' => 'int',
      ),
      'project_title' => array(
        'type' => 'varchar',
        'length' => 128,
      ),
      'amount' => array(
        'type' => 'numeric',
        'precision' => 19,
        'scale' => 4,
      ),
      'tax1' => array(
        'type' => 'numeric',
        'precision' => 19,
        'scale' => 4,
      ),
      'tax2' => array(
        'type' => 'numeric',
        'precision' => 19,
        'scale' => 4,
      ),
      'total' => array(
        'type' => 'numeric',
        'precision' => 19,
        'scale' => 4,
      ),
      'totalcustomercurr' => array(
        'type' => 'numeric',
        'precision' => 19,
        'scale' => 4,
      ),
      'taxexempt' => array(
        'type' => 'int',
        'size' => 'tiny',
      ),
      'src_nid' => array(
        'type' => 'int',
      ),
      'src_vid' => array(
        'type' => 'int',
      ),
    ),
    'primary key' => array(
      'vid',
    ),
    'indexes' => array(
      'nid' => array(
        'nid',
      ),
      'organization_nid' => array(
        'organization_nid',
      ),
      'project_nid' => array(
        'project_nid',
      ),
    ),
  );
  $schema['pminvoice_items'] = array(
    'fields' => array(
      'invoice_nid' => array(
        'type' => 'int',
      ),
      'invoice_vid' => array(
        'type' => 'int',
      ),
      'weight' => array(
        'type' => 'int',
      ),
      'description' => array(
        'type' => 'varchar',
        'length' => 128,
      ),
      'amount' => array(
        'type' => 'numeric',
        'precision' => 19,
        'scale' => 4,
      ),
      'tax1app' => array(
        'type' => 'int',
      ),
      'tax1percent' => array(
        'type' => 'float',
      ),
      'tax1' => array(
        'type' => 'numeric',
        'precision' => 19,
        'scale' => 4,
      ),
      'tax2app' => array(
        'type' => 'int',
      ),
      'tax2percent' => array(
        'type' => 'float',
      ),
      'tax2' => array(
        'type' => 'numeric',
        'precision' => 19,
        'scale' => 4,
      ),
      'total' => array(
        'type' => 'numeric',
        'precision' => 19,
        'scale' => 4,
      ),
      'src_nid' => array(
        'type' => 'int',
      ),
      'src_vid' => array(
        'type' => 'int',
      ),
    ),
    'indexes' => array(
      'invoice_nid' => array(
        'invoice_nid',
      ),
      'invoice_vid' => array(
        'invoice_vid',
      ),
    ),
  );
  return $schema;
}