| 1 |
<?php
|
| 2 |
// $Id: node_example.install,v 1.4 2007/10/05 16:44:50 drewish Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* Implementation of hook_install().
|
| 6 |
*/
|
| 7 |
function node_example_install() {
|
| 8 |
drupal_install_schema('node_example');
|
| 9 |
}
|
| 10 |
|
| 11 |
/**
|
| 12 |
* Implementation of hook_uninstall().
|
| 13 |
*/
|
| 14 |
function node_example_uninstall() {
|
| 15 |
drupal_uninstall_schema('node_example');
|
| 16 |
}
|
| 17 |
|
| 18 |
/**
|
| 19 |
* Implementation of hook_schema().
|
| 20 |
*/
|
| 21 |
function node_example_schema() {
|
| 22 |
$schema['node_example'] = array(
|
| 23 |
'fields' => array(
|
| 24 |
'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
|
| 25 |
'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
|
| 26 |
'color' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
|
| 27 |
'quantity' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
|
| 28 |
),
|
| 29 |
'primary key' => array('vid', 'nid'),
|
| 30 |
);
|
| 31 |
|
| 32 |
return $schema;
|
| 33 |
}
|