changed app name to tc
[eq/.git] / sql / tc.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 `tc_aaronic`
16 --
17 CREATE TABLE `tc_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 `tc_activity`
29 --
30 CREATE TABLE `tc_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 `tc_appointment`
41 --
42 CREATE TABLE `tc_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   `indiv` 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 `tc_assignment`
56 --
57 CREATE TABLE `tc_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 `tc_assignment`
66 --
67 LOCK TABLES `tc_assignment` WRITE;
68 /*!40000 ALTER TABLE `tc_assignment` DISABLE KEYS */;
69 INSERT INTO `tc_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 `tc_assignment` ENABLE KEYS */;
71 UNLOCK TABLES;
72
73 --
74 -- Table structure for table `tc_attendance`
75 --
76 CREATE TABLE `tc_attendance` (
77   `indiv` int(16) unsigned NOT NULL default '0',
78   `date` date default NULL,
79   KEY `indiv` (`indiv`)
80 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
81
82 --
83 -- Table structure for table `tc_calling`
84 --
85 CREATE TABLE `tc_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 `tc_child`
97 --
98 CREATE TABLE `tc_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 `tc_companionship`
110 --
111
112 CREATE TABLE `tc_companionship` (
113   `companionship` int(16) unsigned NOT NULL default '0',
114   `indiv` 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 `tc_district`
123 --
124 CREATE TABLE `tc_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 `tc_indiv`
134 --
135 CREATE TABLE `tc_indiv` (
136   `indiv` 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   `prospective` enum('y','n') DEFAULT 'n',
143   `ppi_pri` int(10) unsigned NOT NULL default '1',
144   `ppi_notes` varchar(128) default NULL,
145   `int_pri` int(10) unsigned default '1',
146   `int_notes` varchar(128) default NULL,
147   `attending` tinyint(1) default '0',
148   `valid` tinyint(1) default NULL,
149   PRIMARY KEY  (`indiv`)
150 ) ENGINE=MyISAM AUTO_INCREMENT=105 DEFAULT CHARSET=latin1;
151
152 --
153 -- Table structure for table `tc_family`
154 --
155 CREATE TABLE `tc_family` (
156   `family` int(16) unsigned NOT NULL auto_increment,
157   `hofh_id` int(16) unsigned NOT NULL default '0',
158   `name` varchar(30) NOT NULL default '',
159   `name_id` varchar(30) NOT NULL default '',
160   `indiv_id` int(16) unsigned default '0',
161   `companionship` int(16) unsigned default NULL,
162   `visit_pri` int(10) unsigned default '1',
163   `visit_notes` varchar(128) default NULL,
164   `valid` tinyint(1) default NULL,
165   PRIMARY KEY  (`family`)
166 ) ENGINE=MyISAM AUTO_INCREMENT=277 DEFAULT CHARSET=latin1;
167
168 --
169 -- Table structure for table `tc_parent`
170 --
171 CREATE TABLE `tc_parent` (
172   `parent` int(16) unsigned NOT NULL auto_increment,
173   `family` int(16) unsigned default NULL,
174   `name` varchar(30) default NULL,
175   `birthday` date default NULL,
176   `phone` varchar(12) default NULL,
177   `address` varchar(255) default NULL,
178   `indiv_id` int(16) unsigned default NULL,
179   `valid` tinyint(1) default NULL,
180   PRIMARY KEY  (`parent`)
181 ) ENGINE=MyISAM AUTO_INCREMENT=396 DEFAULT CHARSET=latin1;
182
183 --
184 -- Table structure for table `tc_participation`
185 --
186 CREATE TABLE `tc_participation` (
187   `indiv` int(16) unsigned NOT NULL default '0',
188   `activity` int(16) unsigned default NULL,
189   UNIQUE KEY `activity_ndx` (`indiv`,`activity`)
190 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
191
192 --
193 -- Table structure for table `tc_interview`
194 --
195 CREATE TABLE `tc_interview` (
196   `interview` int(16) unsigned NOT NULL auto_increment,
197   `interviewer` int(16) unsigned default NULL,
198   `indiv` int(16) unsigned default NULL,
199   `aaronic` int(16) unsigned NOT NULL default '0',
200   `date` date default NULL,
201   `notes` text,
202   `interview_type` enum('hti','ppi') NOT NULL DEFAULT 'hti',
203   PRIMARY KEY  (`ppi`)
204 ) ENGINE=MyISAM AUTO_INCREMENT=248 DEFAULT CHARSET=latin1;
205
206
207 --
208 -- Table structure for table `tc_presidency`
209 --
210 CREATE TABLE `tc_presidency` (
211   `presidency` int(16) unsigned NOT NULL auto_increment,
212   `indiv` int(16) unsigned NOT NULL default '0',
213   `district` int(16) unsigned default '0',
214   `name` varchar(60) NOT NULL,
215   `email` varchar(60) NOT NULL,
216   `president` tinyint(1) default '0',
217   `counselor` tinyint(1) default '0',
218   `secretary` tinyint(1) default '0',
219   `eqpres` tinyint(1) default '0',
220   `valid` tinyint(1) default '1',
221   KEY `presidency` (`presidency`),
222   KEY `indiv` (`indiv`)
223 ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
224
225 --
226 -- Table structure for table `tc_visit`
227 --
228 CREATE TABLE `tc_visit` (
229   `visit` int(16) unsigned NOT NULL auto_increment,
230   `family` int(16) unsigned default NULL,
231   `companionship` int(16) unsigned default NULL,
232   `companion1` int(16) unsigned default NULL,
233   `companion2` int(16) unsigned default NULL,
234   `date` date default NULL,
235   `notes` text,
236   `visited` enum('y','n','') default NULL,
237   `visit_type` enum('presidency','hometeaching') not null default 'hometeaching',
238   PRIMARY KEY  (`visit`)
239 ) ENGINE=MyISAM AUTO_INCREMENT=9513 DEFAULT CHARSET=latin1;
240
241 --
242 -- Table structure for table `tc_willingness`
243 --
244 CREATE TABLE `tc_willingness` (
245   `indiv` int(16) unsigned NOT NULL,
246   `assignment` int(16) unsigned NOT NULL,
247   `willing` enum('y','n','') NOT NULL,
248   KEY `indiv` (`indiv`,`assignment`)
249 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;