You are here

function eloqua_webform_schema in Eloqua 7

Same name and namespace in other branches
  1. 7.2 eloqua_webform/eloqua_webform.install \eloqua_webform_schema()

Implements hook_schema().

File

eloqua_webform/eloqua_webform.install, line 11
Eloqua Webform install, schema, uninstall and update hooks.

Code

function eloqua_webform_schema() {
  $schema = array();
  $schema['eloqua_saved_posts'] = array(
    'description' => 'Webform Settings',
    'primary key' => array(
      'post_id',
    ),
    'unique keys' => array(),
    'indexes' => array(
      'eloqua_saved_posts_form_id' => array(
        'form_id',
      ),
    ),
    'fields' => array(
      'form_id' => array(
        // Associated form ID.
        'description' => 'Form ID that generated this post',
        'type' => 'varchar',
        'size' => 'normal',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'post_id' => array(
        // Serial number.
        'type' => 'serial',
        'size' => 'normal',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'status' => array(
        // Form posted status.
        'description' => 'Eloqua option name',
        'type' => 'varchar',
        'size' => 'normal',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'post_time' => array(
        // Post time.
        'description' => 'Node ID',
        'type' => 'int',
        'size' => 'normal',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'data' => array(
        // Form Contents.
        'description' => 'Extra data to be stored with the field',
        'type' => 'text',
        'size' => 'normal',
        /* 16KB in MySQL */
        'not null' => TRUE,
      ),
    ),
  );
  $schema['eloqua_webform'] = array(
    'description' => 'Webform Settings',
    'primary key' => array(
      'nid',
    ),
    'unique keys' => array(),
    'indexes' => array(
      'eloqua_webform_active' => array(
        'is_active',
      ),
    ),
    'fields' => array(
      'nid' => array(
        // Webform node ID.
        'description' => 'Node ID',
        'type' => 'int',
        'size' => 'normal',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'form_name' => array(
        // Eloqua form name.
        'description' => 'Eloqua form name',
        'type' => 'varchar',
        'size' => 'normal',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
      ),
      'is_active' => array(
        // Is this webform Eloqua enabled?
        'description' => 'Whether this form is Eloqua active',
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
        'unsigned' => TRUE,
      ),
      'data' => array(
        'description' => 'Extra data to be stored with the field',
        'type' => 'text',
        'size' => 'normal',
        /* 16KB in mySql */
        'not null' => TRUE,
      ),
    ),
  );
  return $schema;
}