You are here

function import_node_schema in Import 6

Implementation of hook_schema().

File

examples/import_node/import_node.install, line 41
The install file for the import_node example. This module should not be used on a production installation of Drupal ... it is for illustration purposes only. The install hook removes all traces of what was created by this module and could…

Code

function import_node_schema() {
  $schema['import_example_node'] = array(
    'description' => t('Example table for a node import.'),
    'fields' => array(
      'id' => array(
        'description' => t('Primary key: ID'),
        'type' => 'serial',
      ),
      'headline' => array(
        'description' => t('A headline for this content.'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
        'default' => '',
      ),
      'body' => array(
        'description' => t('The body of this content.'),
        'type' => 'text',
        'size' => 'big',
        'not null' => FALSE,
        'default' => '',
      ),
      'author' => array(
        'description' => t('The author of this content.'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
        'default' => '',
      ),
    ),
    'primary key' => array(
      'id',
    ),
  );
  return $schema;
}