1 tablesort_example.install tablesort_example_schema()

Implements hook_schema().

Related topics

File

modules/examples/tablesort_example/tablesort_example.install, line 39
Install and uninstall functions for the tablesort example module.

Code

function tablesort_example_schema() {
  $schema['tablesort_example'] = array(
    'description' => 'Stores some values for sorting fun.',
    'fields' => array(
      'numbers' => array(
        'description' => 'This column simply holds numbers values',
        'type' => 'varchar',
        'length' => 2,
        'not null' => TRUE,
      ),
      'alpha' => array(
        'description' => 'This column simply holds alpha values',
        'type' => 'varchar',
        'length' => 2,
        'not null' => TRUE,
      ),
      'random' => array(
        'description' => 'This column simply holds random values',
        'type' => 'varchar',
        'length' => 12,
        'not null' => TRUE,
      ),
    ),
    'primary key' => array('numbers'),
  );

  return $schema;
}