You are here

function pardot_update_6001 in Pardot Integration 6

Implementation of hook_update_x().

File

./pardot.install, line 188

Code

function pardot_update_6001() {
  $ret = array();

  // We didn't have any submissions so just drop and rebuild for simplicity.
  db_drop_table($ret, 'pardot_submissions');
  db_create_table($ret, 'pardot_submissions', array(
    'description' => t('Pardot Form submissions'),
    'fields' => array(
      'sid' => array(
        // Internal unique identifier.
        'description' => 'Webform submission id',
        'type' => 'serial',
        'size' => 'normal',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'form_id' => array(
        // Associated Form Id
        'description' => 'Form ID that generated this post',
        'type' => 'varchar',
        'size' => 'normal',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'status' => array(
        // Form Posted status.
        'description' => 'Pardot option name',
        'type' => 'varchar',
        'size' => 'normal',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'submitted' => array(
        // Post Time
        'description' => 'Timestamp of form submission',
        'type' => 'int',
        'size' => 'normal',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'data' => array(
        // Form Contents
        'description' => 'Form values and other data',
        'type' => 'text',
        'size' => 'normal',
        /* 16KB in mySql */
        'not null' => TRUE,
        'serialize' => TRUE,
      ),
    ),
    'primary key' => array(
      'sid',
    ),
  ));
  return $ret;
}