You are here

function bad_schema in Coder 8.2

Same name in this branch
  1. 8.2 coder_sniffer/Drupal/Test/bad/bad.install \bad_schema()
  2. 8.2 coder_sniffer/Drupal/Test/bad/bad.module \bad_schema()
Same name and namespace in other branches
  1. 8.3 tests/Drupal/bad/bad.install \bad_schema()
  2. 8.3 tests/Drupal/bad/bad.module \bad_schema()
  3. 7.2 coder_sniffer/Test/bad/bad.install \bad_schema()
  4. 7.2 coder_sniffer/Test/bad/bad.module \bad_schema()
  5. 8.3.x tests/Drupal/bad/bad.install \bad_schema()
  6. 8.3.x tests/Drupal/bad/bad.module \bad_schema()

Implements hook_schema().

File

coder_sniffer/Drupal/Test/bad/bad.install, line 10
Install, update and uninstall functions for the bad module.

Code

function bad_schema() {
  $schema['good'] = array(
    // We should not use t() here.
    'description' => t('The base table for nodes.'),
    'fields' => array(
      'nid' => array(
        'description' => t('The primary identifier for a node.'),
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'vid' => array(
        'description' => 'The current {node_revision}.vid version identifier.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'type' => array(
        'description' => 'The {node_type} of this node.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'title' => array(
        'description' => 'The title of this node, always treated as non-markup plain text.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'primary key' => array(
      'nid',
    ),
  );
  return $schema;
}