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 `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 `tc_appointment` (
30 `appointment` int(16) unsigned NOT NULL auto_increment,
31 `presidency` 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 `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 -- Dumping data for table `tc_assignment`
54 LOCK TABLES `tc_assignment` WRITE;
55 /*!40000 ALTER TABLE `tc_assignment` DISABLE KEYS */;
56 INSERT INTO `tc_assignment` (`assignment`, `name`, `abbreviation`) 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');
57 /*!40000 ALTER TABLE `tc_assignment` ENABLE KEYS */;
61 -- Table structure for table `tc_attendance`
63 CREATE TABLE `tc_attendance` (
64 `individual` int(16) unsigned NOT NULL default '0',
65 `date` date default NULL,
66 KEY `individual` (`individual`)
67 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
70 -- Table structure for table `tc_calling`
72 CREATE TABLE `tc_calling` (
73 `individual` int(16) unsigned default '0',
74 `organization` varchar(30) default NULL,
75 `position` varchar(30) default NULL,
76 `sustained` varchar(30) default NULL,
77 KEY `individual` (`individual`)
78 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
81 -- Table structure for table `tc_companion`
83 CREATE TABLE `phpgroupware`.`tc_companion` (
84 `companion` INT( 16 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
85 `individual` INT( 16 ) UNSIGNED NOT NULL ,
86 `companionship` INT( 16 ) UNSIGNED NOT NULL ,
87 `scheduling_priority` INT( 16 ) UNSIGNED NOT NULL ,
88 `valid` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0'
92 -- Table structure for table `tc_companionship`
94 CREATE TABLE `phpgroupware`.`tc_companionship` (
95 `companionship` INT( 16 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
96 `mls_id` INT( 16 ) UNSIGNED NULL DEFAULT NULL ,
97 `district` INT( 16 ) UNSIGNED NULL DEFAULT NULL ,
98 `valid` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1'
102 -- Table structure for table `tc_district`
104 CREATE TABLE `tc_district` (
105 `district` int(16) unsigned NOT NULL default '0',
106 `supervisor` int(16) unsigned default NULL,
107 `valid` tinyint(1) default NULL,
108 PRIMARY KEY (`district`)
109 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
112 -- Table structure for table `tc_individual`
114 CREATE TABLE `tc_individual` (
115 `individual` int(16) unsigned NOT NULL auto_increment,
116 `mls_id` int(16) unsigned NOT NULL,
117 `name` varchar(60) default NULL,
118 `fullname` varchar(60) default NULL,
119 `address` varchar(255) default NULL,
120 `phone` varchar(12) default NULL,
121 `email` varchar(120) default NULL,
122 `hh_position` enum('Head of Household','Spouse','Other') DEFAULT 'Other',
123 `priesthood` enum('High Priest','Elder','Priest','Teacher','Deacon','Unordained') DEFAULT NULL,
124 `steward` enum('High Priest','Elder') DEFAULT NULL,
125 `scheduling_priority` int(16) unsigned default NULL,
126 `attending` tinyint(1) default '0',
127 `valid` tinyint(1) default NULL,
128 PRIMARY KEY (`individual`)
129 ) ENGINE=MyISAM AUTO_INCREMENT=105 DEFAULT CHARSET=latin1;
132 -- Table structure for table `tc_family`
134 CREATE TABLE `tc_family` (
135 `family` int(16) unsigned NOT NULL auto_increment,
136 `individual` int(16) unsigned default '0',
137 `companionship` int(16) unsigned default NULL,
138 `scheduling_priority` int(16) unsigned default NULL,
139 `valid` tinyint(1) default NULL,
140 PRIMARY KEY (`family`)
141 ) ENGINE=MyISAM AUTO_INCREMENT=277 DEFAULT CHARSET=latin1;
144 -- Table structure for table `tc_participation`
146 CREATE TABLE `tc_participation` (
147 `individual` int(16) unsigned NOT NULL default '0',
148 `activity` int(16) unsigned default NULL,
149 UNIQUE KEY `activity_ndx` (`individual`,`activity`)
150 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
153 -- Table structure for table `tc_interview`
155 CREATE TABLE `tc_interview` (
156 `interview` int(16) unsigned NOT NULL auto_increment,
157 `interviewer` int(16) unsigned default NULL,
158 `individual` int(16) unsigned default NULL,
159 `date` date default NULL,
161 `interview_type` enum('hti','ppi') NOT NULL DEFAULT 'hti',
162 PRIMARY KEY (`interview`)
163 ) ENGINE=MyISAM AUTO_INCREMENT=248 DEFAULT CHARSET=latin1;
167 -- Table structure for table `tc_presidency`
169 CREATE TABLE `tc_presidency` (
170 `presidency` int(16) unsigned NOT NULL auto_increment,
171 `individual` int(16) unsigned NOT NULL default '0',
172 `district` int(16) unsigned default '0',
173 `email` varchar(60) NOT NULL,
174 `president` tinyint(1) default '0',
175 `counselor` tinyint(1) default '0',
176 `secretary` tinyint(1) default '0',
177 `valid` tinyint(1) default '1',
178 KEY `presidency` (`presidency`),
179 KEY `individual` (`individual`)
180 ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
183 -- Table structure for table `tc_visit`
185 CREATE TABLE `tc_visit` (
186 `visit` int(16) unsigned NOT NULL auto_increment,
187 `family` int(16) unsigned default NULL,
188 `companionship` int(16) unsigned default NULL,
189 `companion1` int(16) unsigned default NULL,
190 `companion2` int(16) unsigned default NULL,
191 `date` date default NULL,
193 `visited` enum('y','n','') default NULL,
194 `visit_type` enum('presidency','hometeaching') not null default 'hometeaching',
195 PRIMARY KEY (`visit`)
196 ) ENGINE=MyISAM AUTO_INCREMENT=9513 DEFAULT CHARSET=latin1;
199 -- Table structure for table `tc_willingness`
201 CREATE TABLE `tc_willingness` (
202 `individual` int(16) unsigned NOT NULL,
203 `assignment` int(16) unsigned NOT NULL,
204 `willing` enum('y','n','') NOT NULL,
205 KEY `individual` (`individual`,`assignment`)
206 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
209 -- Table structure for table `tc_scheduling_priority`
211 CREATE TABLE `tc_scheduling_priority` (
212 `scheduling_priority` INT( 16 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
213 `priority` INT( 10 ) UNSIGNED NOT NULL DEFAULT '30',
214 `notes` VARCHAR( 128 ) NOT NULL DEFAULT ''
218 -- Table structure for table `tc_email_list`
220 CREATE TABLE `tc_email_list` (
221 `email_list` INT( 16 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
222 `name` VARCHAR( 128 ) NULL DEFAULT NULL
226 -- Table structure for table `tc_email_list_membership`
228 CREATE TABLE `tc_email_list_membership` (
229 `individual` INT( 16 ) UNSIGNED NULL DEFAULT NULL ,
230 `email_list` INT( 16 ) UNSIGNED NULL DEFAULT NULL
234 -- Table structure for table `tc_accomplishment`
236 CREATE TABLE `tc_accomplishment` (
237 `accomplishment` INT( 16 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
238 `individual` INT( 16 ) UNSIGNED NULL DEFAULT NULL ,
239 `date` DATE NULL DEFAULT NULL ,
240 `task` INT( 16 ) UNSIGNED NULL DEFAULT NULL ,
241 `note` VARCHAR( 128 ) NOT NULL
245 -- Table structure for table `tc_task`
247 CREATE TABLE `tc_task` (
248 `task` INT( 16 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
249 `name` VARCHAR( 128 ) NOT NULL ,
250 `description` VARCHAR( 128 ) NOT NULL