6090cddb2208b01f5a0f607a592f26f4083a4708
[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_activity`
16 --
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,
21   `notes` text,
22   PRIMARY KEY  (`activity`),
23   KEY `assignment` (`assignment`)
24 ) ENGINE=MyISAM AUTO_INCREMENT=33 DEFAULT CHARSET=latin1;
25
26 --
27 -- Table structure for table `tc_appointment`
28 --
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;
40
41 --
42 -- Table structure for table `tc_assignment`
43 --
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;
50
51 --
52 -- Dumping data for table `tc_assignment`
53 --
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 */;
58 UNLOCK TABLES;
59
60 --
61 -- Table structure for table `tc_attendance`
62 --
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;
68
69 --
70 -- Table structure for table `tc_calling`
71 --
72 CREATE TABLE `tc_calling` (
73   `name` varchar(30) default NULL,
74   `organization` varchar(30) default NULL,
75   `position` varchar(30) default NULL,
76   `sustained` varchar(30) default NULL,
77   KEY `name` (`name`)
78 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
79
80 --
81 -- Table structure for table `tc_companionship`
82 --
83
84 CREATE TABLE `tc_companionship` (
85   `companionship` int(16) unsigned NOT NULL default '0',
86   `individual` int(16) unsigned NOT NULL default '0',
87   `district` int(16) unsigned default NULL,
88   `scheduling_priority` int(16) unsigned default NULL,
89   `valid` tinyint(1) default NULL,
90   KEY `companionship` (`companionship`)
91 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
92
93 --
94 -- Table structure for table `tc_district`
95 --
96 CREATE TABLE `tc_district` (
97   `district` int(16) unsigned NOT NULL default '0',
98   `name` varchar(30) default NULL,
99   `supervisor` int(16) unsigned default NULL,
100   `valid` tinyint(1) default NULL,
101   PRIMARY KEY  (`district`)
102 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
103
104 --
105 -- Table structure for table `tc_individual`
106 --
107 CREATE TABLE `tc_individual` (
108   `individual` int(16) unsigned NOT NULL auto_increment,
109   `mls_id` int(16) unsigned NOT NULL,
110   `name` 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;
122
123 --
124 -- Table structure for table `tc_family`
125 --
126 CREATE TABLE `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;
134
135 --
136 -- Table structure for table `tc_participation`
137 --
138 CREATE TABLE `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;
143
144 --
145 -- Table structure for table `tc_interview`
146 --
147 CREATE TABLE `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,
152   `notes` text,
153   `interview_type` enum('hti','ppi') NOT NULL DEFAULT 'hti',
154   PRIMARY KEY  (`interview`)
155 ) ENGINE=MyISAM AUTO_INCREMENT=248 DEFAULT CHARSET=latin1;
156
157
158 --
159 -- Table structure for table `tc_presidency`
160 --
161 CREATE TABLE `tc_presidency` (
162   `presidency` int(16) unsigned NOT NULL auto_increment,
163   `individual` int(16) unsigned NOT NULL default '0',
164   `district` int(16) unsigned default '0',
165   `email` varchar(60) NOT NULL,
166   `president` tinyint(1) default '0',
167   `counselor` tinyint(1) default '0',
168   `secretary` tinyint(1) default '0',
169   `valid` tinyint(1) default '1',
170   KEY `presidency` (`presidency`),
171   KEY `individual` (`individual`)
172 ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
173
174 --
175 -- Table structure for table `tc_visit`
176 --
177 CREATE TABLE `tc_visit` (
178   `visit` int(16) unsigned NOT NULL auto_increment,
179   `family` int(16) unsigned default NULL,
180   `companionship` int(16) unsigned default NULL,
181   `companion1` int(16) unsigned default NULL,
182   `companion2` int(16) unsigned default NULL,
183   `date` date default NULL,
184   `notes` text,
185   `visited` enum('y','n','') default NULL,
186   `visit_type` enum('presidency','hometeaching') not null default 'hometeaching',
187   PRIMARY KEY  (`visit`)
188 ) ENGINE=MyISAM AUTO_INCREMENT=9513 DEFAULT CHARSET=latin1;
189
190 --
191 -- Table structure for table `tc_willingness`
192 --
193 CREATE TABLE `tc_willingness` (
194   `individual` int(16) unsigned NOT NULL,
195   `assignment` int(16) unsigned NOT NULL,
196   `willing` enum('y','n','') NOT NULL,
197   KEY `individual` (`individual`,`assignment`)
198 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
199
200 --
201 -- Table structure for table `tc_scheduling_priority`
202 --
203 CREATE TABLE `tc_scheduling_priority` (
204   `scheduling_priority` INT( 16 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
205   `priority` INT( 10 ) UNSIGNED NOT NULL DEFAULT '30',
206   `notes` VARCHAR( 128 ) NOT NULL DEFAULT ''
207 ) ENGINE = MYISAM ;
208
209 --
210 -- Table structure for table `tc_email_list`
211 --
212 CREATE TABLE `tc_email_list` (
213   `email_list` INT( 16 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
214   `name` VARCHAR( 128 ) NULL DEFAULT NULL
215 ) ENGINE = MYISAM ;
216
217 --
218 -- Table structure for table `tc_email_list_membership`
219 --
220 CREATE TABLE `tc_email_list_membership` (
221   `individual` INT( 16 ) UNSIGNED NULL DEFAULT NULL ,
222   `email_list` INT( 16 ) UNSIGNED NULL DEFAULT NULL
223 ) ENGINE = MYISAM ;
224
225 --
226 -- Table structure for table `tc_accomplishment`
227 --
228 CREATE TABLE `tc_accomplishment` (
229   `accomplishment` INT( 16 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
230   `individual` INT( 16 ) UNSIGNED NULL DEFAULT NULL ,
231   `date` DATE NULL DEFAULT NULL ,
232   `task` INT( 16 ) UNSIGNED NULL DEFAULT NULL ,
233   `note` VARCHAR( 128 ) NOT NULL
234 ) ENGINE = MYISAM ;
235
236 --
237 -- Table structure for table `tc_task`
238 --
239 CREATE TABLE `tc_task` (
240   `task` INT( 16 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
241   `name` VARCHAR( 128 ) NOT NULL ,
242   `description` VARCHAR( 128 ) NOT NULL
243 ) ENGINE = MYISAM ;