function tablesort_example_schema

Same name in other branches
  1. 3.x modules/tablesort_example/tablesort_example.install \tablesort_example_schema()
  2. 7.x-1.x tablesort_example/tablesort_example.install \tablesort_example_schema()
  3. 4.0.x modules/tablesort_example/tablesort_example.install \tablesort_example_schema()

Implements hook_schema().

Related topics

File

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;
}