| 1 |
<?php
|
| 2 |
// $Id: validation_api.install,v 1.7 2008/07/24 17:16:29 tapocol Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
*/
|
| 7 |
|
| 8 |
function validation_api_schema() {
|
| 9 |
$schema['validation_api_validators'] = array(
|
| 10 |
'fields' => array(
|
| 11 |
'vavid' => array(
|
| 12 |
'type' => 'serial',
|
| 13 |
'unsigned' => TRUE,
|
| 14 |
'not null' => TRUE,
|
| 15 |
),
|
| 16 |
'name' => array(
|
| 17 |
'type' => 'varchar',
|
| 18 |
'length' => 32,
|
| 19 |
'not null' => TRUE,
|
| 20 |
'default' => '',
|
| 21 |
),
|
| 22 |
'type' => array(
|
| 23 |
'type' => 'varchar',
|
| 24 |
'length' => 16,
|
| 25 |
'not null' => TRUE,
|
| 26 |
'default' => '',
|
| 27 |
),
|
| 28 |
'rule' => array(
|
| 29 |
'type' => 'text',
|
| 30 |
'not null' => TRUE,
|
| 31 |
'default' => '',
|
| 32 |
),
|
| 33 |
'message' => array(
|
| 34 |
'type' => 'varchar',
|
| 35 |
'length' => 256,
|
| 36 |
'not null' => TRUE,
|
| 37 |
'default' => '',
|
| 38 |
),
|
| 39 |
'module' => array(
|
| 40 |
'type' => 'varchar',
|
| 41 |
'length' => 32,
|
| 42 |
'default' => NULL,
|
| 43 |
),
|
| 44 |
'delta' => array(
|
| 45 |
'type' => 'int',
|
| 46 |
'size' => 'tiny',
|
| 47 |
'not null' => TRUE,
|
| 48 |
'default' => 0,
|
| 49 |
),
|
| 50 |
),
|
| 51 |
'primary key' => array('vavid'),
|
| 52 |
'unique keys' => array('name' => array('name')),
|
| 53 |
);
|
| 54 |
|
| 55 |
$schema['validation_api_fields'] = array(
|
| 56 |
'fields' => array(
|
| 57 |
'vafid' => array(
|
| 58 |
'type' => 'serial',
|
| 59 |
'unsigned' => TRUE,
|
| 60 |
'not null' => TRUE,
|
| 61 |
),
|
| 62 |
'form_id' => array(
|
| 63 |
'type' => 'varchar',
|
| 64 |
'length' => 64,
|
| 65 |
'not null' => TRUE,
|
| 66 |
),
|
| 67 |
'form_field' => array(
|
| 68 |
'type' => 'varchar',
|
| 69 |
'length' => 64,
|
| 70 |
'not null' => TRUE,
|
| 71 |
),
|
| 72 |
'vavid' => array(
|
| 73 |
'type' => 'int',
|
| 74 |
'unsigned' => TRUE,
|
| 75 |
'not null' => TRUE,
|
| 76 |
),
|
| 77 |
'arg' => array(
|
| 78 |
'type' => 'varchar',
|
| 79 |
'length' => 32,
|
| 80 |
'not null' => TRUE,
|
| 81 |
'default' => '',
|
| 82 |
),
|
| 83 |
'allow_empty' => array(
|
| 84 |
'type' => 'int',
|
| 85 |
'size' => 'tiny',
|
| 86 |
'not null' => TRUE,
|
| 87 |
'default' => 0,
|
| 88 |
),
|
| 89 |
'message' => array(
|
| 90 |
'type' => 'varchar',
|
| 91 |
'length' => 256,
|
| 92 |
'not null' => TRUE,
|
| 93 |
'default' => '',
|
| 94 |
),
|
| 95 |
),
|
| 96 |
'primary key' => array('vafid'),
|
| 97 |
'indexes' => array(
|
| 98 |
'va_form_id' => array('form_id'),
|
| 99 |
'va_form_field' => array('form_field'),
|
| 100 |
),
|
| 101 |
);
|
| 102 |
|
| 103 |
return $schema;
|
| 104 |
}
|
| 105 |
|
| 106 |
function validation_api_install() {
|
| 107 |
drupal_install_schema('validation_api');
|
| 108 |
|
| 109 |
db_query('UPDATE {system} SET weight = 50 WHERE name = "validation_api" AND type = "module"');
|
| 110 |
}
|
| 111 |
|
| 112 |
function validation_api_uninstall() {
|
| 113 |
drupal_uninstall_schema('validation_api');
|
| 114 |
}
|