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