Removed data being added to district table.
[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   `uid` bigint(64) unsigned NOT NULL default '0',
49   PRIMARY KEY  (`appointment`)
50 ) ENGINE=MyISAM AUTO_INCREMENT=132 DEFAULT CHARSET=latin1;
51
52 --
53 -- Table structure for table `eq_assignment`
54 --
55 CREATE TABLE `eq_assignment` (
56   `assignment` int(12) unsigned NOT NULL auto_increment,
57   `name` varchar(60) NOT NULL,
58   `code` varchar(12) default NULL,
59   PRIMARY KEY  (`assignment`)
60 ) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
61
62 --
63 -- Dumping data for table `eq_assignment`
64 --
65 LOCK TABLES `eq_assignment` WRITE;
66 /*!40000 ALTER TABLE `eq_assignment` DISABLE KEYS */;
67 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');
68 /*!40000 ALTER TABLE `eq_assignment` ENABLE KEYS */;
69 UNLOCK TABLES;
70
71 --
72 -- Table structure for table `eq_attendance`
73 --
74 CREATE TABLE `eq_attendance` (
75   `elder` int(16) unsigned NOT NULL default '0',
76   `date` date default NULL,
77   KEY `elder` (`elder`)
78 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
79
80 --
81 -- Table structure for table `eq_calling`
82 --
83 CREATE TABLE `eq_calling` (
84   `indiv_id` int(16) unsigned default NULL,
85   `name` varchar(30) default NULL,
86   `organization` varchar(30) default NULL,
87   `position` varchar(30) default NULL,
88   `sequence` int(16) unsigned default NULL,
89   `sustained` varchar(30) default NULL,
90   KEY `indiv_id` (`indiv_id`)
91 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
92
93 --
94 -- Table structure for table `eq_child`
95 --
96 CREATE TABLE `eq_child` (
97   `child` int(16) unsigned NOT NULL auto_increment,
98   `family` int(16) unsigned default NULL,
99   `name` varchar(30) default NULL,
100   `birthday` date default NULL,
101   `indiv_id` int(16) unsigned default NULL,
102   `valid` tinyint(1) default NULL,
103   PRIMARY KEY  (`child`)
104 ) ENGINE=MyISAM AUTO_INCREMENT=260 DEFAULT CHARSET=latin1;
105
106 --
107 -- Table structure for table `eq_companionship`
108 --
109
110 CREATE TABLE `eq_companionship` (
111   `companionship` int(16) unsigned NOT NULL default '0',
112   `elder` int(16) unsigned NOT NULL default '0',
113   `aaronic` int(16) unsigned NOT NULL default '0',
114   `district` int(16) unsigned default NULL,
115   `valid` tinyint(1) default NULL,
116   KEY `companionship` (`companionship`)
117 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
118
119 --
120 -- Table structure for table `eq_district`
121 --
122 CREATE TABLE `eq_district` (
123   `district` int(16) unsigned NOT NULL default '0',
124   `name` varchar(30) default NULL,
125   `supervisor` int(16) unsigned default NULL,
126   `valid` tinyint(1) default NULL,
127   PRIMARY KEY  (`district`)
128 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
129
130 --
131 -- Table structure for table `eq_elder`
132 --
133 CREATE TABLE `eq_elder` (
134   `elder` int(16) unsigned NOT NULL auto_increment,
135   `name` varchar(60) default NULL,
136   `phone` varchar(12) default NULL,
137   `ppi_pri` int(10) unsigned NOT NULL default '1',
138   `ppi_notes` varchar(128) default NULL,
139   `int_pri` int(10) unsigned default '1',
140   `int_notes` varchar(128) default NULL,
141   `attending` tinyint(1) default '0',
142   `valid` tinyint(1) default NULL,
143   PRIMARY KEY  (`elder`)
144 ) ENGINE=MyISAM AUTO_INCREMENT=105 DEFAULT CHARSET=latin1;
145
146 --
147 -- Table structure for table `eq_family`
148 --
149 CREATE TABLE `eq_family` (
150   `family` int(16) unsigned NOT NULL auto_increment,
151   `hofh_id` int(16) unsigned NOT NULL default '0',
152   `name` varchar(30) NOT NULL default '',
153   `name_id` varchar(30) NOT NULL default '',
154   `elder_id` int(16) unsigned default '0',
155   `companionship` int(16) unsigned default NULL,
156   `visit_pri` int(10) unsigned default '1',
157   `visit_notes` varchar(128) default NULL,
158   `valid` tinyint(1) default NULL,
159   PRIMARY KEY  (`family`)
160 ) ENGINE=MyISAM AUTO_INCREMENT=277 DEFAULT CHARSET=latin1;
161
162 --
163 -- Table structure for table `eq_interview`
164 --
165 CREATE TABLE `eq_interview` (
166   `interview` int(16) unsigned NOT NULL auto_increment,
167   `interviewer` int(16) unsigned default NULL,
168   `elder` int(16) unsigned default NULL,
169   `aaronic` int(16) unsigned NOT NULL default '0',
170   `date` date default NULL,
171   `notes` text,
172   PRIMARY KEY  (`interview`)
173 ) ENGINE=MyISAM AUTO_INCREMENT=65 DEFAULT CHARSET=latin1;
174
175 --
176 -- Table structure for table `eq_parent`
177 --
178 CREATE TABLE `eq_parent` (
179   `parent` int(16) unsigned NOT NULL auto_increment,
180   `family` int(16) unsigned default NULL,
181   `name` varchar(30) default NULL,
182   `birthday` date default NULL,
183   `phone` varchar(12) default NULL,
184   `address` varchar(255) default NULL,
185   `indiv_id` int(16) unsigned default NULL,
186   `valid` tinyint(1) default NULL,
187   PRIMARY KEY  (`parent`)
188 ) ENGINE=MyISAM AUTO_INCREMENT=396 DEFAULT CHARSET=latin1;
189
190 --
191 -- Table structure for table `eq_participation`
192 --
193 CREATE TABLE `eq_participation` (
194   `elder` int(16) unsigned NOT NULL default '0',
195   `activity` int(16) unsigned default NULL,
196   UNIQUE KEY `activity_ndx` (`elder`,`activity`)
197 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
198
199 --
200 -- Table structure for table `eq_ppi`
201 --
202 CREATE TABLE `eq_ppi` (
203   `ppi` int(16) unsigned NOT NULL auto_increment,
204   `interviewer` int(16) unsigned default NULL,
205   `elder` int(16) unsigned default NULL,
206   `date` date default NULL,
207   `notes` text,
208   `eqpresppi` tinyint(1) default '0',
209   PRIMARY KEY  (`ppi`)
210 ) ENGINE=MyISAM AUTO_INCREMENT=248 DEFAULT CHARSET=latin1;
211
212
213 --
214 -- Table structure for table `eq_presidency`
215 --
216 CREATE TABLE `eq_presidency` (
217   `presidency` int(16) unsigned NOT NULL auto_increment,
218   `elder` int(16) unsigned NOT NULL default '0',
219   `district` int(16) unsigned default '0',
220   `name` varchar(60) NOT NULL,
221   `email` varchar(60) NOT NULL,
222   `president` tinyint(1) default '0',
223   `counselor` tinyint(1) default '0',
224   `secretary` tinyint(1) default '0',
225   `valid` tinyint(1) default '1',
226   KEY `presidency` (`presidency`),
227   KEY `elder` (`elder`)
228 ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
229
230 --
231 -- Table structure for table `eq_visit`
232 --
233 CREATE TABLE `eq_visit` (
234   `visit` int(16) unsigned NOT NULL auto_increment,
235   `family` int(16) unsigned default NULL,
236   `companionship` int(16) unsigned default NULL,
237   `date` date default NULL,
238   `notes` text,
239   `visited` enum('y','n','') default NULL,
240   PRIMARY KEY  (`visit`)
241 ) ENGINE=MyISAM AUTO_INCREMENT=9513 DEFAULT CHARSET=latin1;
242
243 --
244 -- Table structure for table `eq_willingness`
245 --
246 CREATE TABLE `eq_willingness` (
247   `elder` int(16) unsigned NOT NULL,
248   `assignment` int(16) unsigned NOT NULL,
249   `willing` enum('y','n','') NOT NULL,
250   KEY `elder` (`elder`,`assignment`)
251 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;