| 1 |
<?php
|
| 2 |
|
| 3 |
/**
|
| 4 |
* Implementation of hook_schema()
|
| 5 |
*/
|
| 6 |
function webform_paths_schema() {
|
| 7 |
$schema['webform_paths'] = array(
|
| 8 |
'description' => t('The base table for re-usable webforms.'),
|
| 9 |
'fields' => array(
|
| 10 |
'pathid' => array(
|
| 11 |
'description' => t('The primary identifier for a re-usable webform.'),
|
| 12 |
'type' => 'serial',
|
| 13 |
'unsigned' => TRUE,
|
| 14 |
'not null' => TRUE),
|
| 15 |
'nid' => array(
|
| 16 |
'description' => t('The identifier for a node.'),
|
| 17 |
'type' => 'int',
|
| 18 |
'unsigned' => TRUE,
|
| 19 |
'not null' => TRUE),
|
| 20 |
'title' => array(
|
| 21 |
'description' => t('The title of this webform path.'),
|
| 22 |
'type' => 'varchar',
|
| 23 |
'length' => 255,
|
| 24 |
'not null' => TRUE,
|
| 25 |
'default' => ''),
|
| 26 |
'path' => array(
|
| 27 |
'description' => t('The path of this webform path.'),
|
| 28 |
'type' => 'varchar',
|
| 29 |
'length' => 255,
|
| 30 |
'not null' => TRUE,
|
| 31 |
'default' => ''),
|
| 32 |
'message' => array(
|
| 33 |
'description' => t('A message to be displayed to the user.'),
|
| 34 |
'type' => 'text',
|
| 35 |
'not null' => TRUE,
|
| 36 |
'size' => 'medium'),
|
| 37 |
),
|
| 38 |
'indexes' => array(
|
| 39 |
'nid' => array('nid'),
|
| 40 |
),
|
| 41 |
'unique keys' => array(
|
| 42 |
'path' => array('path')
|
| 43 |
),
|
| 44 |
'primary key' => array('pathid'),
|
| 45 |
);
|
| 46 |
|
| 47 |
return $schema;
|
| 48 |
}
|
| 49 |
|
| 50 |
function webform_paths_install() {
|
| 51 |
drupal_install_schema('webform_paths');
|
| 52 |
drupal_set_message('Webform paths module has been successfully installed.');
|
| 53 |
}
|
| 54 |
|
| 55 |
function webform_paths_uninstall() {
|
| 56 |
drupal_uninstall_schema('webform_paths');
|
| 57 |
drupal_set_message('Webform paths module has been successfully uninstalled.');
|
| 58 |
}
|