/[drupal]/contributions/docs/developer/examples/nodeapi_example.install
ViewVC logotype

Contents of /contributions/docs/developer/examples/nodeapi_example.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.4 - (show annotations) (download) (as text)
Fri Oct 5 16:44:50 2007 UTC (2 years, 1 month ago) by drewish
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-6--1
Changes since 1.3: +16 -1 lines
File MIME type: text/x-php
Schema is back in the .install file now.
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 }

  ViewVC Help
Powered by ViewVC 1.1.2