summaryrefslogtreecommitdiff
path: root/modules/simpletest/tests/taxonomy_test.install
blob: ae741f0e6fe3dba4552da9d6d48f712e323d0edf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
// $Id$

/**
 * @file
 * Install, update and uninstall functions for the taxonomy_test module.
 */

/**
 * Implement hook_schema().
 */
function taxonomy_test_schema() {
  $schema['term_antonym'] = array(
    'description' => 'Stores term antonyms.',
    'fields' => array(
      'taid' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'Primary Key: Unique term antonym ID.',
      ),
      'tid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The {taxonomy_term_data}.tid of the term.',
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => 'The name of the antonym.',
      ),
    ),
    'indexes' => array(
      'tid' => array('tid'),
      'name_tid' => array('name', 'tid'),
    ),
    'primary key' => array('taid'),
  );

  return $schema;
}

/**
 * Implement hook_install().
 */
function taxonomy_test_install() {
  drupal_install_schema('taxonomy_test');
}

/**
 * Implement hook_uninstall().
 */
function taxonomy_test_uninstall() {
  drupal_uninstall_schema('taxonomy_test');
}