| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
|
| 4 |
function workflow_fields_install() {
|
| 5 |
$result = array();
|
| 6 |
|
| 7 |
switch ($GLOBALS['db_type']) {
|
| 8 |
case 'mysqli':
|
| 9 |
case 'mysql':
|
| 10 |
$result[] = db_query(
|
| 11 |
<<<QUERY
|
| 12 |
CREATE TABLE {workflow_fields} (
|
| 13 |
`sid` int(10) NOT NULL,
|
| 14 |
`name` varchar(100) NOT NULL,
|
| 15 |
`type` varchar(100) NOT NULL,
|
| 16 |
`visible` tinyint(4) NOT NULL,
|
| 17 |
`editable` tinyint(4) NOT NULL,
|
| 18 |
PRIMARY KEY (`sid`,`name`,`type`)
|
| 19 |
) /*!40100 DEFAULT CHARACTER SET utf8 */;
|
| 20 |
QUERY
|
| 21 |
);
|
| 22 |
break;
|
| 23 |
}
|
| 24 |
if (count($result) == count(array_filter($result))) {
|
| 25 |
drupal_set_message(t('The workflow_fields module has successfully added tables to the database.'));
|
| 26 |
}
|
| 27 |
else {
|
| 28 |
drupal_set_message(t('Drupal was unable to install the database tables for the workflow_fields module.'), 'error');
|
| 29 |
}
|
| 30 |
}
|
| 31 |
|
| 32 |
?>
|