fixed sql table creation file and import script
[eq/.git] / sql / tc.sql
index 531b98e02ec3e36afcee0baaf3d3c962766eae70..2fedef164a486579352634ad614571b9cc0fbf92 100644 (file)
@@ -70,13 +70,11 @@ CREATE TABLE `tc_attendance` (
 -- Table structure for table `tc_calling`
 --
 CREATE TABLE `tc_calling` (
-  `indiv_id` int(16) unsigned default NULL,
   `name` varchar(30) default NULL,
   `organization` varchar(30) default NULL,
   `position` varchar(30) default NULL,
-  `sequence` int(16) unsigned default NULL,
   `sustained` varchar(30) default NULL,
-  KEY `indiv_id` (`indiv_id`)
+  KEY `name` (`name`)
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
 --
@@ -87,6 +85,7 @@ CREATE TABLE `tc_companionship` (
   `companionship` int(16) unsigned NOT NULL default '0',
   `individual` int(16) unsigned NOT NULL default '0',
   `district` int(16) unsigned default NULL,
+  `scheduling_priority` int(16) unsigned default NULL,
   `valid` tinyint(1) default NULL,
   KEY `companionship` (`companionship`)
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
@@ -112,14 +111,10 @@ CREATE TABLE `tc_individual` (
   `address` varchar(255) default NULL,
   `phone` varchar(12) default NULL,
   `email` varchar(120) default NULL,
-  `family` int(16) unsigned default NULL,
   `hh_position` enum('Head of Household','Spouse','Other') DEFAULT 'Other',
   `priesthood` enum('High Priest','Elder','Priest','Teacher','Deacon','Unordained') DEFAULT NULL,
   `steward` enum('High Priest','Elder') DEFAULT NULL,
-  `ppi_pri` int(10) unsigned NOT NULL default '1',
-  `ppi_notes` varchar(128) default NULL,
-  `hti_pri` int(10) unsigned default '1',
-  `hti_notes` varchar(128) default NULL,
+  `scheduling_priority` int(16) unsigned default NULL,
   `attending` tinyint(1) default '0',
   `valid` tinyint(1) default NULL,
   PRIMARY KEY  (`individual`)
@@ -130,13 +125,9 @@ CREATE TABLE `tc_individual` (
 --
 CREATE TABLE `tc_family` (
   `family` int(16) unsigned NOT NULL auto_increment,
-  `hofh_id` int(16) unsigned NOT NULL default '0',
-  `name` varchar(30) NOT NULL default '',
-  `name_id` varchar(30) NOT NULL default '',
   `individual` int(16) unsigned default '0',
   `companionship` int(16) unsigned default NULL,
-  `visit_pri` int(10) unsigned default '1',
-  `visit_notes` varchar(128) default NULL,
+  `scheduling_priority` int(16) unsigned default NULL,
   `valid` tinyint(1) default NULL,
   PRIMARY KEY  (`family`)
 ) ENGINE=MyISAM AUTO_INCREMENT=277 DEFAULT CHARSET=latin1;
@@ -160,7 +151,7 @@ CREATE TABLE `tc_interview` (
   `date` date default NULL,
   `notes` text,
   `interview_type` enum('hti','ppi') NOT NULL DEFAULT 'hti',
-  PRIMARY KEY  (`ppi`)
+  PRIMARY KEY  (`interview`)
 ) ENGINE=MyISAM AUTO_INCREMENT=248 DEFAULT CHARSET=latin1;
 
 
@@ -206,3 +197,48 @@ CREATE TABLE `tc_willingness` (
   `willing` enum('y','n','') NOT NULL,
   KEY `individual` (`individual`,`assignment`)
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+--
+-- Table structure for table `tc_scheduling_priority`
+--
+CREATE TABLE `tc_scheduling_priority` (
+`scheduling_priority` INT( 16 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+`priority` INT( 10 ) UNSIGNED NOT NULL DEFAULT '30',
+`notes` VARCHAR( 128 ) NOT NULL DEFAULT ''
+) ENGINE = MYISAM ;
+
+--
+-- Table structure for table `tc_email_list`
+--
+CREATE TABLE `tc_email_list` (
+`email_list` INT( 16 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+`name` VARCHAR( 128 ) NULL DEFAULT NULL
+) ENGINE = MYISAM ;
+
+--
+-- Table structure for table `tc_email_list_membership`
+--
+CREATE TABLE `tc_email_list_membership` (
+`individual` INT( 16 ) UNSIGNED NULL DEFAULT NULL ,
+`email_list` INT( 16 ) UNSIGNED NULL DEFAULT NULL
+) ENGINE = MYISAM ;
+
+--
+-- Table structure for table `tc_accomplishment`
+--
+CREATE TABLE `tc_accomplishment` (
+`accomplishment` INT( 16 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+`individual` INT( 16 ) UNSIGNED NULL DEFAULT NULL ,
+`date` DATE NULL DEFAULT NULL ,
+`task` INT( 16 ) UNSIGNED NULL DEFAULT NULL ,
+`note` VARCHAR( 128 ) NOT NULL
+) ENGINE = MYISAM ;
+
+--
+-- Table structure for table `tc_task`
+--
+CREATE TABLE `tc_task` (
+`task` INT( 16 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+`name` VARCHAR( 128 ) NOT NULL ,
+`description` VARCHAR( 128 ) NOT NULL
+) ENGINE = MYISAM ;