123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
- /**
- * @file
- * Contains install and update functions for uc_webform.
- */
- /**
- * Implementation of hook_field_schema.
- */
- function uc_webform_schema() {
- $schema = array(
- 'uc_webform' => array(
- 'fields' => array(
- 'nid' => array(
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- ),
- 'webform_nid' => array(
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => FALSE,
- 'default' => 0,
- ),
- 'submit' => array(
- 'type' => 'int',
- 'size' => 'tiny',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'default' => 0,
- ),
- ),
- 'primary key' => array('nid'),
- ),
- 'uc_webform_submission' => array(
- 'fields' => array(
- 'sid' => array(
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- ),
- 'order_id' => array(
- 'type' => 'int',
- 'unsigned' => TRUE,
- ),
- ),
- ),
- );
- return $schema;
- }
- function uc_webform_update_7000() {
- $schema = uc_webform_schema();
- db_create_table('uc_webform_submission', $schema['uc_webform_submission']);
- }
- function uc_webform_update_7010() {
- $schema = uc_webform_schema();
- db_add_field('uc_webform', 'submit', $schema['uc_webform']['fields']['submit']);
- }
- function uc_webform_update_7020() {
- $schema = uc_webform_schema();
- db_change_field('uc_webform', 'webform_nid', 'webform_nid', $schema['uc_webform']['fields']['webform_nid']);
- }
|