You are here

function fillpdf_schema in FillPDF 7

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

Implements hook_schema().

File

./fillpdf.install, line 11
Install.

Code

function fillpdf_schema() {
  $schema = array();
  $schema['fillpdf_forms'] = array(
    'fields' => array(
      'fid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'title' => array(
        'type' => 'varchar',
        'length' => 512,
        'not null' => TRUE,
      ),
      'default_nid' => array(
        'type' => 'varchar',
        'length' => 255,
      ),
      'url' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'destination_path' => array(
        'type' => 'varchar',
        'length' => 255,
      ),
      'replacements' => array(
        'type' => 'text',
        'size' => 'normal',
      ),
      'destination_redirect' => array(
        'type' => 'int',
        'unsigned' => TRUE,
      ),
      'admin_title' => array(
        'type' => 'varchar',
        'length' => 512,
      ),
      'scheme' => array(
        'type' => 'varchar',
        'length' => 64,
      ),
      'default_entity_type' => array(
        'type' => 'varchar',
        'length' => 255,
      ),
    ),
    'primary key' => array(
      'fid',
    ),
  );
  $schema['fillpdf_fields'] = array(
    'fields' => array(
      'fid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'pdf_key' => array(
        'type' => 'varchar',
        'length' => 255,
        'binary' => TRUE,
        'not null' => TRUE,
      ),
      'label' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'prefix' => array(
        'type' => 'varchar',
        'length' => 4096,
      ),
      'value' => array(
        'type' => 'text',
        'size' => 'medium',
        'not null' => TRUE,
      ),
      'suffix' => array(
        'type' => 'varchar',
        'length' => 4096,
      ),
      'replacements' => array(
        'type' => 'text',
        'size' => 'normal',
      ),
    ),
    'primary key' => array(
      'fid',
      'pdf_key',
    ),
  );
  $schema['fillpdf_file_context'] = array(
    'fields' => array(
      'fcid' => array(
        'description' => 'The unique identifier representing this FillPDF file context.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'context' => array(
        'description' => 'JSON representing the FillPDF file context.',
        'type' => 'text',
        'size' => 'normal',
      ),
      'fid' => array(
        'description' => 'The {file_usage.fid} of the FillPDF file.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'fcid',
    ),
  );
  return $schema;
}