function tablesort_example_schema

Implements hook_schema().

Related topics

File

modules/tablesort_example/tablesort_example.install, line 53

Code

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