nodeapi_example.install

<?php

// $Id: nodeapi_example.install,v 1.4 2007/10/05 16:44:50 drewish Exp $

/**
 * Implementation of hook_install().
 */
function nodeapi_example_install() {
  drupal_install_schema('nodeapi_example');
}

/**
 * Implementation of hook_uninstall().
 */
function nodeapi_example_uninstall() {
  drupal_uninstall_schema('nodeapi_example');
}

/**
 * Implementation of hook_schema().
 */
function nodeapi_example_schema() {
  $schema['nodeapi_example'] = array(
    'fields' => array(
      'nid'    => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
      'rating' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
    ),
    'primary key' => array('nid'),
  );

  return $schema;
}

function nodeapi_example_update_1() {
  return _system_update_utf8(array('nodeapi_example'));
}
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.