A weight field should not be unsigned, doh
[drupal_tabor_2010.git] / partner / partner.install
blobc5c8abe4f411ae0e7ac5ed7af967c5f41bab7091
1 <?php
2 // $Id$
4 /**
5  * @file
6  * Installation file for partner management.
7  */
9 /**
10  * Implementation of hook_install().
11  */
12 function partner_install() {
13   drupal_install_schema('partner');
16 /**
17  * Implementation of hook_uninstall().
18  */
19 function partner_uninstall() {
20   drupal_uninstall_schema('partner');
23 /**
24  * Implementation of hook_schema().
25  */
26 function partner_schema() {
27   $schema['partner'] = array(
28     'description' => 'Stores partner data',
29     'fields' => array(
30       'pid' => array(
31         'type' => 'serial',
32         'unsigned' => TRUE,
33         'not null' => TRUE,
34         'description' => 'Primary Key: Unique partner ID.',
35       ),
36       'name' => array(
37         'type' => 'varchar',
38         'length' => 100,
39         'not null' => TRUE,
40         'description' => 'Name.',
41       ),
42       'favourite' => array(
43         'type' => 'varchar',
44         'length' => 100,
45         'not null' => TRUE,
46         'default' => '',
47         'description' => 'Favourite beer.',
48       ),
49     ),
50     'indexes' => array(
51       'favourite' => array('favourite'),
52     ),
53     'unique keys' => array(
54       'name' => array('name'),
55     ),
56     'primary key' => array('pid'),
57   );
58   $schema['address'] = array(
59     'description' => 'Stores partner data',
60     'fields' => array(
61       'aid' => array(
62         'type' => 'serial',
63         'unsigned' => TRUE,
64         'not null' => TRUE,
65         'description' => 'Primary Key: Unique address ID.',
66       ),
67       'pid' => array(
68         'type' => 'int',
69         'unsigned' => TRUE,
70         'not null' => TRUE,
71         'description' => 'Partner ID this address belongs to.',
72       ),
73       'zipcode' => array(
74         'type' => 'varchar',
75         'length' => 10,
76         'not null' => TRUE,
77         'description' => 'Zip code.',
78       ),
79       'city' => array(
80         'type' => 'varchar',
81         'length' => 100,
82         'not null' => TRUE,
83         'description' => 'City.',
84       ),
85       'street' => array(
86         'type' => 'varchar',
87         'length' => 100,
88         'description' => 'Street address.',
89       ),
90       'weight' => array(
91         'type' => 'int',
92         'not null' => TRUE,
93         'default' => 0,
94         'description' => 'Weight.',
95       ),
96     ),
97     'indexes' => array(
98       'pid' => array('pid'),
99       'zipcode' => array('zipcode'),
100       'city' => array('city'),
101       'weight' => array('weight'),
102     ),
103     'primary key' => array('aid'),
104   );
105   return $schema;