Added new fields to sql db create script
[eq/.git] / sql / eq.sql
1 -- MySQL dump 10.11
2 --
3 -- Host: localhost    Database: phpgroupware
4 -- ------------------------------------------------------
5
6 --
7 -- Current Database: `phpgroupware`
8 --
9
10 CREATE DATABASE /*!32312 IF NOT EXISTS*/ `phpgroupware` /*!40100 DEFAULT CHARACTER SET latin1 */;
11
12 USE `phpgroupware`;
13
14 --
15 -- Table structure for table `eq_aaronic`
16 --
17 CREATE TABLE `eq_aaronic` (
18   `aaronic` int(16) unsigned NOT NULL auto_increment,
19   `name` varchar(60) default NULL,
20   `phone` varchar(12) default NULL,
21   `valid` tinyint(1) default NULL,
22   PRIMARY KEY  (`aaronic`)
23 ) ENGINE=MyISAM AUTO_INCREMENT=92 DEFAULT CHARSET=latin1;
24
25
26 --
27 -- Table structure for table `eq_activity`
28 --
29 CREATE TABLE `eq_activity` (
30   `activity` int(16) unsigned NOT NULL auto_increment,
31   `assignment` int(16) unsigned NOT NULL,
32   `date` date default NULL,
33   `notes` text,
34   PRIMARY KEY  (`activity`),
35   KEY `assignment` (`assignment`)
36 ) ENGINE=MyISAM AUTO_INCREMENT=33 DEFAULT CHARSET=latin1;
37
38 --
39 -- Table structure for table `eq_appointment`
40 --
41 CREATE TABLE `eq_appointment` (
42   `appointment` int(16) unsigned NOT NULL auto_increment,
43   `presidency` int(16) unsigned NOT NULL default '0',
44   `family` int(16) unsigned default '0',
45   `elder` int(16) unsigned default '0',
46   `date` date NOT NULL default '0000-00-00',
47   `time` time NOT NULL default '00:00:00',
48   `location` varchar(120) default NULL,
49   `uid` bigint(64) unsigned NOT NULL default '0',
50   PRIMARY KEY  (`appointment`)
51 ) ENGINE=MyISAM AUTO_INCREMENT=132 DEFAULT CHARSET=latin1;
52
53 --
54 -- Table structure for table `eq_assignment`
55 --
56 CREATE TABLE `eq_assignment` (
57   `assignment` int(12) unsigned NOT NULL auto_increment,
58   `name` varchar(60) NOT NULL,
59   `code` varchar(12) default NULL,
60   PRIMARY KEY  (`assignment`)
61 ) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
62
63 --
64 -- Dumping data for table `eq_assignment`
65 --
66 LOCK TABLES `eq_assignment` WRITE;
67 /*!40000 ALTER TABLE `eq_assignment` DISABLE KEYS */;
68 INSERT INTO `eq_assignment` (`assignment`, `name`, `code`) VALUES (1,'Enrichment Night Babysitting','RS'),(2,'Building Lockup','LU'),(3,'Building Cleaning Coordinator','CC'),(4,'Missionary Splits','MS'),(5,'Stake Farm','SF'),(6,'Loveland Kitchen','LK'),(7,'Moves','MV'),(8,'Temple Kitchen & Laundary','TKL'),(9,'Temple Sealings','TS'),(10,'Temple Initatories','TI');
69 /*!40000 ALTER TABLE `eq_assignment` ENABLE KEYS */;
70 UNLOCK TABLES;
71
72 --
73 -- Table structure for table `eq_attendance`
74 --
75 CREATE TABLE `eq_attendance` (
76   `elder` int(16) unsigned NOT NULL default '0',
77   `date` date default NULL,
78   KEY `elder` (`elder`)
79 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
80
81 --
82 -- Table structure for table `eq_calling`
83 --
84 CREATE TABLE `eq_calling` (
85   `indiv_id` int(16) unsigned default NULL,
86   `name` varchar(30) default NULL,
87   `organization` varchar(30) default NULL,
88   `position` varchar(30) default NULL,
89   `sequence` int(16) unsigned default NULL,
90   `sustained` varchar(30) default NULL,
91   KEY `indiv_id` (`indiv_id`)
92 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
93
94 --
95 -- Table structure for table `eq_child`
96 --
97 CREATE TABLE `eq_child` (
98   `child` int(16) unsigned NOT NULL auto_increment,
99   `family` int(16) unsigned default NULL,
100   `name` varchar(30) default NULL,
101   `birthday` date default NULL,
102   `indiv_id` int(16) unsigned default NULL,
103   `valid` tinyint(1) default NULL,
104   PRIMARY KEY  (`child`)
105 ) ENGINE=MyISAM AUTO_INCREMENT=260 DEFAULT CHARSET=latin1;
106
107 --
108 -- Table structure for table `eq_companionship`
109 --
110
111 CREATE TABLE `eq_companionship` (
112   `companionship` int(16) unsigned NOT NULL default '0',
113   `elder` int(16) unsigned NOT NULL default '0',
114   `aaronic` int(16) unsigned NOT NULL default '0',
115   `district` int(16) unsigned default NULL,
116   `valid` tinyint(1) default NULL,
117   KEY `companionship` (`companionship`)
118 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
119
120 --
121 -- Table structure for table `eq_district`
122 --
123 CREATE TABLE `eq_district` (
124   `district` int(16) unsigned NOT NULL default '0',
125   `name` varchar(30) default NULL,
126   `supervisor` int(16) unsigned default NULL,
127   `valid` tinyint(1) default NULL,
128   PRIMARY KEY  (`district`)
129 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
130
131 --
132 -- Table structure for table `eq_elder`
133 --
134 CREATE TABLE `eq_elder` (
135   `elder` int(16) unsigned NOT NULL auto_increment,
136   `indiv_id` int(16) unsigned NOT NULL,
137   `name` varchar(60) default NULL,
138   `phone` varchar(12) default NULL,
139   `email` varchar(120) default NULL,
140   `ppi_pri` int(10) unsigned NOT NULL default '1',
141   `ppi_notes` varchar(128) default NULL,
142   `int_pri` int(10) unsigned default '1',
143   `int_notes` varchar(128) default NULL,
144   `attending` tinyint(1) default '0',
145   `valid` tinyint(1) default NULL,
146   PRIMARY KEY  (`elder`)
147 ) ENGINE=MyISAM AUTO_INCREMENT=105 DEFAULT CHARSET=latin1;
148
149 --
150 -- Table structure for table `eq_family`
151 --
152 CREATE TABLE `eq_family` (
153   `family` int(16) unsigned NOT NULL auto_increment,
154   `hofh_id` int(16) unsigned NOT NULL default '0',
155   `name` varchar(30) NOT NULL default '',
156   `name_id` varchar(30) NOT NULL default '',
157   `elder_id` int(16) unsigned default '0',
158   `companionship` int(16) unsigned default NULL,
159   `visit_pri` int(10) unsigned default '1',
160   `visit_notes` varchar(128) default NULL,
161   `valid` tinyint(1) default NULL,
162   PRIMARY KEY  (`family`)
163 ) ENGINE=MyISAM AUTO_INCREMENT=277 DEFAULT CHARSET=latin1;
164
165 --
166 -- Table structure for table `eq_parent`
167 --
168 CREATE TABLE `eq_parent` (
169   `parent` int(16) unsigned NOT NULL auto_increment,
170   `family` int(16) unsigned default NULL,
171   `name` varchar(30) default NULL,
172   `birthday` date default NULL,
173   `phone` varchar(12) default NULL,
174   `address` varchar(255) default NULL,
175   `indiv_id` int(16) unsigned default NULL,
176   `valid` tinyint(1) default NULL,
177   PRIMARY KEY  (`parent`)
178 ) ENGINE=MyISAM AUTO_INCREMENT=396 DEFAULT CHARSET=latin1;
179
180 --
181 -- Table structure for table `eq_participation`
182 --
183 CREATE TABLE `eq_participation` (
184   `elder` int(16) unsigned NOT NULL default '0',
185   `activity` int(16) unsigned default NULL,
186   UNIQUE KEY `activity_ndx` (`elder`,`activity`)
187 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
188
189 --
190 -- Table structure for table `eq_ppi`
191 --
192 CREATE TABLE `eq_ppi` (
193   `ppi` int(16) unsigned NOT NULL auto_increment,
194   `interviewer` int(16) unsigned default NULL,
195   `elder` int(16) unsigned default NULL,
196   `aaronic` int(16) unsigned NOT NULL default '0',
197   `date` date default NULL,
198   `notes` text,
199   `eqpresppi` tinyint(1) default '0',
200   PRIMARY KEY  (`ppi`)
201 ) ENGINE=MyISAM AUTO_INCREMENT=248 DEFAULT CHARSET=latin1;
202
203
204 --
205 -- Table structure for table `eq_presidency`
206 --
207 CREATE TABLE `eq_presidency` (
208   `presidency` int(16) unsigned NOT NULL auto_increment,
209   `elder` int(16) unsigned NOT NULL default '0',
210   `district` int(16) unsigned default '0',
211   `name` varchar(60) NOT NULL,
212   `email` varchar(60) NOT NULL,
213   `president` tinyint(1) default '0',
214   `counselor` tinyint(1) default '0',
215   `secretary` tinyint(1) default '0',
216   `eqpres` tinyint(1) default '0',
217   `valid` tinyint(1) default '1',
218   KEY `presidency` (`presidency`),
219   KEY `elder` (`elder`)
220 ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
221
222 --
223 -- Table structure for table `eq_visit`
224 --
225 CREATE TABLE `eq_visit` (
226   `visit` int(16) unsigned NOT NULL auto_increment,
227   `family` int(16) unsigned default NULL,
228   `companionship` int(16) unsigned default NULL,
229   `date` date default NULL,
230   `notes` text,
231   `visited` enum('y','n','') default NULL,
232   PRIMARY KEY  (`visit`)
233 ) ENGINE=MyISAM AUTO_INCREMENT=9513 DEFAULT CHARSET=latin1;
234
235 --
236 -- Table structure for table `eq_willingness`
237 --
238 CREATE TABLE `eq_willingness` (
239   `elder` int(16) unsigned NOT NULL,
240   `assignment` int(16) unsigned NOT NULL,
241   `willing` enum('y','n','') NOT NULL,
242   KEY `elder` (`elder`,`assignment`)
243 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;