3 -- Host: localhost Database: phpgroupware
4 -- ------------------------------------------------------
7 -- Current Database: `phpgroupware`
10 CREATE DATABASE /*!32312 IF NOT EXISTS*/ `phpgroupware` /*!40100 DEFAULT CHARACTER SET latin1 */;
15 -- Table structure for table `tc_activity`
17 CREATE TABLE /*!42501 IF NOT EXISTS*/ `tc_activity` (
18 `activity` int(16) unsigned NOT NULL auto_increment,
19 `assignment` int(16) unsigned NOT NULL,
20 `date` date default NULL,
22 PRIMARY KEY (`activity`),
23 KEY `assignment` (`assignment`)
24 ) ENGINE=MyISAM AUTO_INCREMENT=33 DEFAULT CHARSET=latin1;
27 -- Table structure for table `tc_appointment`
29 CREATE TABLE /*!42501 IF NOT EXISTS*/ `tc_appointment` (
30 `appointment` int(16) unsigned NOT NULL auto_increment,
31 `leader` int(16) unsigned NOT NULL default '0',
32 `family` int(16) unsigned default '0',
33 `individual` int(16) unsigned default '0',
34 `date` date NOT NULL default '0000-00-00',
35 `time` time NOT NULL default '00:00:00',
36 `location` varchar(120) default NULL,
37 `uid` bigint(64) unsigned NOT NULL default '0',
38 PRIMARY KEY (`appointment`)
39 ) ENGINE=MyISAM AUTO_INCREMENT=132 DEFAULT CHARSET=latin1;
42 -- Table structure for table `tc_assignment`
44 CREATE TABLE /*!42501 IF NOT EXISTS*/ `tc_assignment` (
45 `assignment` int(12) unsigned NOT NULL auto_increment,
46 `name` varchar(60) NOT NULL,
47 `abbreviation` varchar(12) default NULL,
48 PRIMARY KEY (`assignment`)
49 ) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
52 -- Table structure for table `tc_attendance`
54 CREATE TABLE /*!42501 IF NOT EXISTS*/ `tc_attendance` (
55 `individual` int(16) unsigned NOT NULL default '0',
56 `date` date default NULL,
57 KEY `individual` (`individual`)
58 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
61 -- Table structure for table `tc_calling`
63 CREATE TABLE /*!42501 IF NOT EXISTS*/ `tc_calling` (
64 `individual` int(16) unsigned default '0',
65 `organization` varchar(30) default NULL,
66 `position` varchar(30) default NULL,
67 `sustained` varchar(30) default NULL,
68 KEY `individual` (`individual`)
69 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
72 -- Table structure for table `tc_companion`
74 CREATE TABLE /*!42501 IF NOT EXISTS*/ `tc_companion` (
75 `companion` INT( 16 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
76 `individual` INT( 16 ) UNSIGNED NOT NULL ,
77 `companionship` INT( 16 ) UNSIGNED NOT NULL ,
78 `scheduling_priority` INT( 16 ) UNSIGNED NOT NULL ,
79 `valid` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0'
83 -- Table structure for table `tc_companionship`
85 CREATE TABLE /*!42501 IF NOT EXISTS*/ `tc_companionship` (
86 `companionship` INT( 16 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
87 `mls_id` INT( 16 ) UNSIGNED NULL DEFAULT NULL ,
88 `district` INT( 16 ) UNSIGNED NULL DEFAULT NULL ,
89 `type` ENUM( 'H', 'P' ) NOT NULL DEFAULT 'H' ,
90 `valid` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1'
94 -- Table structure for table `tc_district`
96 CREATE TABLE /*!42501 IF NOT EXISTS*/ `tc_district` (
97 `district` int(16) unsigned NOT NULL default '0',
98 `leader` int(16) unsigned default NULL,
99 `valid` tinyint(1) default NULL,
100 PRIMARY KEY (`district`)
101 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
104 -- Table structure for table `tc_individual`
106 CREATE TABLE /*!42501 IF NOT EXISTS*/ `tc_individual` (
107 `individual` int(16) unsigned NOT NULL auto_increment,
108 `mls_id` int(16) unsigned NOT NULL,
109 `name` varchar(60) default NULL,
110 `fullname` varchar(60) default NULL,
111 `address` varchar(255) default NULL,
112 `phone` varchar(12) default NULL,
113 `email` varchar(120) default NULL,
114 `hh_position` enum('Head of Household','Spouse','Other') DEFAULT 'Other',
115 `priesthood` enum('High Priest','Elder','Priest','Teacher','Deacon','Unordained') DEFAULT NULL,
116 `steward` enum('High Priest','Elder') DEFAULT NULL,
117 `scheduling_priority` int(16) unsigned default NULL,
118 `attending` tinyint(1) default '0',
119 `valid` tinyint(1) default NULL,
120 PRIMARY KEY (`individual`)
121 ) ENGINE=MyISAM AUTO_INCREMENT=105 DEFAULT CHARSET=latin1;
124 -- Table structure for table `tc_family`
126 CREATE TABLE /*!42501 IF NOT EXISTS*/ `tc_family` (
127 `family` int(16) unsigned NOT NULL auto_increment,
128 `individual` int(16) unsigned default '0',
129 `companionship` int(16) unsigned default NULL,
130 `scheduling_priority` int(16) unsigned default NULL,
131 `valid` tinyint(1) default NULL,
132 PRIMARY KEY (`family`)
133 ) ENGINE=MyISAM AUTO_INCREMENT=277 DEFAULT CHARSET=latin1;
136 -- Table structure for table `tc_participation`
138 CREATE TABLE /*!42501 IF NOT EXISTS*/ `tc_participation` (
139 `individual` int(16) unsigned NOT NULL default '0',
140 `activity` int(16) unsigned default NULL,
141 UNIQUE KEY `activity_ndx` (`individual`,`activity`)
142 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
145 -- Table structure for table `tc_interview`
147 CREATE TABLE /*!42501 IF NOT EXISTS*/ `tc_interview` (
148 `interview` int(16) unsigned NOT NULL auto_increment,
149 `interviewer` int(16) unsigned default NULL,
150 `individual` int(16) unsigned default NULL,
151 `date` date default NULL,
153 `type` enum('H','P') NOT NULL DEFAULT 'H',
154 PRIMARY KEY (`interview`)
155 ) ENGINE=MyISAM AUTO_INCREMENT=248 DEFAULT CHARSET=latin1;
159 -- Table structure for table `tc_leader`
161 CREATE TABLE /*!42501 IF NOT EXISTS*/ `tc_leader` (
162 `leader` int(16) unsigned NOT NULL auto_increment,
163 `individual` int(16) unsigned NOT NULL default '0',
164 `email` varchar(60) NOT NULL,
165 `type` enum( 'P', 'C', 'S', 'D' ) NOT NULL,
166 `valid` tinyint(1) default '1',
167 KEY `leader` (`leader`),
168 KEY `individual` (`individual`)
169 ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
172 -- Table structure for table `tc_visit`
174 CREATE TABLE /*!42501 IF NOT EXISTS*/ `tc_visit` (
175 `visit` int(16) unsigned NOT NULL auto_increment,
176 `family` int(16) unsigned default NULL,
177 `companionship` int(16) unsigned default NULL,
178 `date` date default NULL,
180 `visited` enum('y','n','') default NULL,
181 `type` enum('P','H') not null default 'H',
182 PRIMARY KEY (`visit`)
183 ) ENGINE=MyISAM AUTO_INCREMENT=9513 DEFAULT CHARSET=latin1;
186 -- Table structure for table `tc_willingness`
188 CREATE TABLE /*!42501 IF NOT EXISTS*/ `tc_willingness` (
189 `individual` int(16) unsigned NOT NULL,
190 `assignment` int(16) unsigned NOT NULL,
191 `willing` enum('y','n','') NOT NULL,
192 KEY `individual` (`individual`,`assignment`)
193 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
196 -- Table structure for table `tc_scheduling_priority`
198 CREATE TABLE /*!42501 IF NOT EXISTS*/ `tc_scheduling_priority` (
199 `scheduling_priority` INT( 16 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
200 `priority` INT( 10 ) UNSIGNED NOT NULL DEFAULT '30',
201 `notes` VARCHAR( 128 ) NOT NULL DEFAULT ''
205 -- Table structure for table `tc_email_list`
207 CREATE TABLE /*!42501 IF NOT EXISTS*/ `tc_email_list` (
208 `email_list` INT( 16 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
209 `name` VARCHAR( 128 ) NULL DEFAULT NULL
213 -- Table structure for table `tc_email_list_membership`
215 CREATE TABLE /*!42501 IF NOT EXISTS*/ `tc_email_list_membership` (
216 `individual` INT( 16 ) UNSIGNED NULL DEFAULT NULL ,
217 `email_list` INT( 16 ) UNSIGNED NULL DEFAULT NULL
221 -- Table structure for table `tc_accomplishment`
223 CREATE TABLE /*!42501 IF NOT EXISTS*/ `tc_accomplishment` (
224 `accomplishment` INT( 16 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
225 `individual` INT( 16 ) UNSIGNED NULL DEFAULT NULL ,
226 `date` DATE NULL DEFAULT NULL ,
227 `task` INT( 16 ) UNSIGNED NULL DEFAULT NULL ,
228 `notes` VARCHAR( 128 ) NOT NULL
232 -- Table structure for table `tc_task`
234 CREATE TABLE /*!42501 IF NOT EXISTS*/ `tc_task` (
235 `task` INT( 16 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
236 `name` VARCHAR( 128 ) NOT NULL ,
237 `description` VARCHAR( 128 ) NOT NULL
241 -- Table structure for table `tc_district_sandbox`
243 CREATE TABLE /*!42501 IF NOT EXISTS*/ `tc_district_sandbox` (
244 `district` INT( 16 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
245 `leader` INT( 16 ) UNSIGNED NULL DEFAULT NULL
249 -- Table structure for table `tc_companion_sandbox`
251 CREATE TABLE /*!42501 IF NOT EXISTS*/ `tc_companion_sandbox` (
252 `companion` INT( 16 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
253 `individual` INT( 16 ) UNSIGNED NOT NULL ,
254 `companionship` INT( 16 ) UNSIGNED NOT NULL
258 -- Table structure for table `tc_companionship_sandbox`
260 CREATE TABLE /*!42501 IF NOT EXISTS*/ `tc_companionship_sandbox` (
261 `companionship` INT( 16 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
262 `tc_companionship` INT( 16 ) UNSIGNED NOT NULL ,
263 `district` INT( 16 ) UNSIGNED NULL DEFAULT NULL
267 -- Table structure for table `tc_family_sandbox`
269 CREATE TABLE /*!42501 IF NOT EXISTS*/ `tc_family_sandbox` (
270 `family` int(16) unsigned NOT NULL auto_increment,
271 `tc_family` int(16) unsigned default '0',
272 `individual` INT( 16 ) UNSIGNED NOT NULL ,
273 `companionship` int(16) unsigned default NULL,
274 PRIMARY KEY (`family`)