# Update to add priority and assigned person to actions 2005-01-19
# ALTER TABLE `action` ADD `priority` INT DEFAULT 'NULL' NULL ,
#  ADD `assigned_contact_id` INT DEFAULT '0';

USE Your db;

# --------------------------------------------------------

#
# Table structure for table `action`
#

CREATE TABLE `action` (
  `id` int(11) NOT NULL auto_increment,
  `contact_id` int(11) default '0',
  `group_id` int(11) default '0',
  `type` varchar(100) NOT NULL default '',
  `title` varchar(250) NOT NULL default '',
  `detail` text NOT NULL,
  `date_target` date default NULL,
  `date_completed` date default NULL,
  `time` varchar(100) default NULL,
  `priority` int default 50,
  `assigned_contact_id` int default 0 NULL,
  PRIMARY KEY  (`id`),
  FULLTEXT KEY `time` (`time`)
) TYPE=MyISAM AUTO_INCREMENT=296 ;

# --------------------------------------------------------

#
# Table structure for table `comments_actions`
#

CREATE TABLE `comments_actions` (
  `comment_id` int(11) NOT NULL auto_increment,
  `contact_id` int(11) NOT NULL default '0',
  `comment` varchar(150) NOT NULL default '',
  `comment_date` date NOT NULL default '0000-00-00',
  `action_date` date NOT NULL default '0000-00-00',
  PRIMARY KEY  (`comment_id`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;

# --------------------------------------------------------

#
# Table structure for table `contacts`
#

CREATE TABLE `contacts` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(100) default NULL,
  `company_name` varchar(100) default NULL,
  `address_1` varchar(100) default NULL,
  `address_2` varchar(100) default NULL,
  `address_3` varchar(100) default NULL,
  `city` varchar(100) default NULL,
  `post_code` varchar(10) default NULL,
  `tel_main` varchar(20) default NULL,
  `tel_alternative` varchar(20) default NULL,
  `e_mail` varchar(100) default NULL,
  `www` varchar(250) default NULL,
  `fax` varchar(100) default NULL,
  `group_id` int(11) default '0',
  `spam_me` tinyint(1) default '0',
  `password` varchar(255) default NULL,
  PRIMARY KEY  (`id`),
  FULLTEXT KEY `company_name` (`company_name`),
  FULLTEXT KEY `company_name_2` (`company_name`)
) TYPE=MyISAM AUTO_INCREMENT=1508 ;

# --------------------------------------------------------

#
# Table structure for table `e_mail_history`
#

CREATE TABLE `e_mail_history` (
  `id` int(11) NOT NULL auto_increment,
  `email_to` varchar(250) default NULL,
  `group_to` int(11) NOT NULL default '0',
  `subject` varchar(250) NOT NULL default '',
  `email_text` text NOT NULL,
  `date` date NOT NULL default '0000-00-00',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM AUTO_INCREMENT=10 ;

# --------------------------------------------------------

#
# Table structure for table `groups`
#

CREATE TABLE `groups` (
  `group_id` int(11) NOT NULL auto_increment,
  `group_name` varchar(40) default NULL,
  PRIMARY KEY  (`group_id`)
) TYPE=MyISAM AUTO_INCREMENT=40 ;
