| 1 |
<?php
|
| 2 |
|
| 3 |
// $Id: nodeapi_example.install,v 1.3 2007/08/14 17:46:18 drewish Exp $
|
| 4 |
|
| 5 |
/**
|
| 6 |
* Implementation of hook_install().
|
| 7 |
*/
|
| 8 |
function nodeapi_example_install() {
|
| 9 |
drupal_install_schema('nodeapi_example');
|
| 10 |
}
|
| 11 |
|
| 12 |
/**
|
| 13 |
* Implementation of hook_uninstall().
|
| 14 |
*/
|
| 15 |
function nodeapi_example_uninstall() {
|
| 16 |
drupal_uninstall_schema('nodeapi_example');
|
| 17 |
}
|
| 18 |
|
| 19 |
/**
|
| 20 |
* Implementation of hook_schema().
|
| 21 |
*/
|
| 22 |
function nodeapi_example_schema() {
|
| 23 |
$schema['nodeapi_example'] = array(
|
| 24 |
'fields' => array(
|
| 25 |
'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
|
| 26 |
'rating' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
|
| 27 |
),
|
| 28 |
'primary key' => array('nid'),
|
| 29 |
);
|
| 30 |
|
| 31 |
return $schema;
|
| 32 |
}
|
| 33 |
|
| 34 |
function nodeapi_example_update_1() {
|
| 35 |
return _system_update_utf8(array('nodeapi_example'));
|
| 36 |
}
|