82e631b271ffcbb6b43f785d4cb37ec86ed658d6
[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   `indiv` 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   `code` 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`, `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');
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   `indiv` int(16) unsigned NOT NULL default '0',
65   `date` date default NULL,
66   KEY `indiv` (`indiv`)
67 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
68
69 --
70 -- Table structure for table `tc_calling`
71 --
72 CREATE TABLE `tc_calling` (
73   `indiv_id` int(16) unsigned default NULL,
74   `name` varchar(30) default NULL,
75   `organization` varchar(30) default NULL,
76   `position` varchar(30) default NULL,
77   `sequence` int(16) unsigned default NULL,
78   `sustained` varchar(30) default NULL,
79   KEY `indiv_id` (`indiv_id`)
80 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
81
82 --
83 -- Table structure for table `tc_companionship`
84 --
85
86 CREATE TABLE `tc_companionship` (
87   `companionship` int(16) unsigned NOT NULL default '0',
88   `indiv` int(16) unsigned NOT NULL default '0',
89   `district` int(16) unsigned default NULL,
90   `valid` tinyint(1) default NULL,
91   KEY `companionship` (`companionship`)
92 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
93
94 --
95 -- Table structure for table `tc_district`
96 --
97 CREATE TABLE `tc_district` (
98   `district` int(16) unsigned NOT NULL default '0',
99   `name` varchar(30) default NULL,
100   `supervisor` int(16) unsigned default NULL,
101   `valid` tinyint(1) default NULL,
102   PRIMARY KEY  (`district`)
103 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
104
105 --
106 -- Table structure for table `tc_indiv`
107 --
108 CREATE TABLE `tc_indiv` (
109   `indiv` int(16) unsigned NOT NULL auto_increment,
110   `indiv_id` int(16) unsigned NOT NULL,
111   `name` varchar(60) default NULL,
112   `birthday` date default NULL,
113   `address` varchar(255) default NULL,
114   `phone` varchar(12) default NULL,
115   `email` varchar(120) default NULL,
116   `family` int(16) unsigned default NULL,
117   `hh_position` enum('Head of Household','Spouse','Other') DEFAULT 'Other',
118   `priesthood` enum('High Priest','Elder','Priest','Teacher','Deacon','Unordained') DEFAULT NULL,
119   `steward` enum('High Priest','Elder') DEFAULT NULL,
120   `ppi_pri` int(10) unsigned NOT NULL default '1',
121   `ppi_notes` varchar(128) default NULL,
122   `int_pri` int(10) unsigned default '1',
123   `int_notes` varchar(128) default NULL,
124   `attending` tinyint(1) default '0',
125   `valid` tinyint(1) default NULL,
126   PRIMARY KEY  (`indiv`)
127 ) ENGINE=MyISAM AUTO_INCREMENT=105 DEFAULT CHARSET=latin1;
128
129 --
130 -- Table structure for table `tc_family`
131 --
132 CREATE TABLE `tc_family` (
133   `family` int(16) unsigned NOT NULL auto_increment,
134   `hofh_id` int(16) unsigned NOT NULL default '0',
135   `name` varchar(30) NOT NULL default '',
136   `name_id` varchar(30) NOT NULL default '',
137   `indiv_id` int(16) unsigned default '0',
138   `companionship` int(16) unsigned default NULL,
139   `visit_pri` int(10) unsigned default '1',
140   `visit_notes` varchar(128) default NULL,
141   `valid` tinyint(1) default NULL,
142   PRIMARY KEY  (`family`)
143 ) ENGINE=MyISAM AUTO_INCREMENT=277 DEFAULT CHARSET=latin1;
144
145 --
146 -- Table structure for table `tc_participation`
147 --
148 CREATE TABLE `tc_participation` (
149   `indiv` int(16) unsigned NOT NULL default '0',
150   `activity` int(16) unsigned default NULL,
151   UNIQUE KEY `activity_ndx` (`indiv`,`activity`)
152 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
153
154 --
155 -- Table structure for table `tc_interview`
156 --
157 CREATE TABLE `tc_interview` (
158   `interview` int(16) unsigned NOT NULL auto_increment,
159   `interviewer` int(16) unsigned default NULL,
160   `indiv` int(16) unsigned default NULL,
161   `date` date default NULL,
162   `notes` text,
163   `interview_type` enum('hti','ppi') NOT NULL DEFAULT 'hti',
164   PRIMARY KEY  (`ppi`)
165 ) ENGINE=MyISAM AUTO_INCREMENT=248 DEFAULT CHARSET=latin1;
166
167
168 --
169 -- Table structure for table `tc_presidency`
170 --
171 CREATE TABLE `tc_presidency` (
172   `presidency` int(16) unsigned NOT NULL auto_increment,
173   `indiv` int(16) unsigned NOT NULL default '0',
174   `district` int(16) unsigned default '0',
175   `name` varchar(60) NOT NULL,
176   `email` varchar(60) NOT NULL,
177   `president` tinyint(1) default '0',
178   `counselor` tinyint(1) default '0',
179   `secretary` tinyint(1) default '0',
180   `eqpres` tinyint(1) default '0',
181   `valid` tinyint(1) default '1',
182   KEY `presidency` (`presidency`),
183   KEY `indiv` (`indiv`)
184 ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
185
186 --
187 -- Table structure for table `tc_visit`
188 --
189 CREATE TABLE `tc_visit` (
190   `visit` int(16) unsigned NOT NULL auto_increment,
191   `family` int(16) unsigned default NULL,
192   `companionship` int(16) unsigned default NULL,
193   `companion1` int(16) unsigned default NULL,
194   `companion2` int(16) unsigned default NULL,
195   `date` date default NULL,
196   `notes` text,
197   `visited` enum('y','n','') default NULL,
198   `visit_type` enum('presidency','hometeaching') not null default 'hometeaching',
199   PRIMARY KEY  (`visit`)
200 ) ENGINE=MyISAM AUTO_INCREMENT=9513 DEFAULT CHARSET=latin1;
201
202 --
203 -- Table structure for table `tc_willingness`
204 --
205 CREATE TABLE `tc_willingness` (
206   `indiv` int(16) unsigned NOT NULL,
207   `assignment` int(16) unsigned NOT NULL,
208   `willing` enum('y','n','') NOT NULL,
209   KEY `indiv` (`indiv`,`assignment`)
210 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;