--
-- Host: localhost    Database: whatwhat
-- ------------------------------------------------------


--
-- Current Database: `whatwhat`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `whatwhat` /*!40100 DEFAULT CHARACTER SET latin1 */;

USE `whatwhat`;

--
-- Table structure for table `answer`
--

CREATE TABLE `answer` (
  `id` int(11) NOT NULL auto_increment,
  `answer` text,
  `creation_date` datetime default NULL,
  `question_id` int(11) default NULL,
  `creator_id` int(11) default NULL,
  PRIMARY KEY  (`id`),
  KEY `idx_question` (`question_id`),
  KEY `idx_creator` (`creator_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `answer`
--



--
-- Table structure for table `groups`
--

CREATE TABLE `groups` (
  `id` int(11) NOT NULL auto_increment,
  `group_name` varchar(16) NOT NULL default '',
  `display_name` varchar(255) default NULL,
  `created` datetime default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `group_name` (`group_name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `groups`
--


INSERT INTO `groups` VALUES (1,'admin','Administrators','2006-03-06 14:11:00');

--
-- Table structure for table `issue`
--

CREATE TABLE `issue` (
  `id` int(11) NOT NULL auto_increment,
  `issue` text,
  `impact` int(11) default NULL,
  `closed` tinyint(4) default NULL,
  `project_id` int(11) default NULL,
  `creator_id` int(11) default NULL,
  `creation_date` datetime default NULL,
  PRIMARY KEY  (`id`),
  KEY `idx_project` (`project_id`),
  KEY `idx_creator` (`creator_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `issue`
--



--
-- Table structure for table `note`
--

CREATE TABLE `note` (
  `id` int(11) NOT NULL auto_increment,
  `note` text,
  `creation_date` datetime default NULL,
  `last_edit_date` datetime default NULL,
  `project_id` int(11) default NULL,
  `creator_id` int(11) default NULL,
  PRIMARY KEY  (`id`),
  KEY `idx_project` (`project_id`),
  KEY `idx_creator` (`creator_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `note`
--



--
-- Table structure for table `permission`
--

CREATE TABLE `permission` (
  `id` int(11) NOT NULL auto_increment,
  `permission_id` varchar(16) NOT NULL default '',
  `description` varchar(255) default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `permission_id` (`permission_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `permission`
--



--
-- Table structure for table `person`
--

CREATE TABLE `person` (
  `id` int(11) NOT NULL auto_increment,
  `display_name` varchar(255) NOT NULL default '',
  `user_id` varchar(32) NOT NULL default '',
  `password` text,
  `email_address` text,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `display_name` (`display_name`),
  UNIQUE KEY `user_id` (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `person`
--


INSERT INTO `person` VALUES (1,'Administrator','admin','21232f297a57a5a743894a0e4a801fc3','operations@dev.gawab.com');

--
-- Table structure for table `project`
--

CREATE TABLE `project` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `description` text,
  `archived` tinyint(4) default NULL,
  `status` int(11) default NULL,
  `parent_project_id` int(11) default NULL,
  `contact_id` int(11) default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `name` (`name`),
  KEY `idx_contact` (`contact_id`),
  KEY `idx_project` (`parent_project_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `project`
--



--
-- Table structure for table `project_file`
--

CREATE TABLE `project_file` (
  `id` int(11) NOT NULL auto_increment,
  `filename` text,
  `systemfilename` text,
  `creation_date` datetime default NULL,
  `project_id` int(11) default NULL,
  `creator_id` int(11) default NULL,
  PRIMARY KEY  (`id`),
  KEY `idx_creator` (`creator_id`),
  KEY `idx_project` (`project_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `project_file`
--



--
-- Table structure for table `question`
--

CREATE TABLE `question` (
  `id` int(11) NOT NULL auto_increment,
  `question` text,
  `creation_date` datetime default NULL,
  `project_id` int(11) default NULL,
  `creator_id` int(11) default NULL,
  PRIMARY KEY  (`id`),
  KEY `idx_project` (`project_id`),
  KEY `idx_creator` (`creator_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `question`
--



--
-- Table structure for table `risk`
--

CREATE TABLE `risk` (
  `id` int(11) NOT NULL auto_increment,
  `chance` int(11) default NULL,
  `impact` int(11) default NULL,
  `description` text,
  `closed` tinyint(4) default NULL,
  `creation_date` datetime default NULL,
  `project_id` int(11) default NULL,
  `creator_id` int(11) default NULL,
  PRIMARY KEY  (`id`),
  KEY `idx_project` (`project_id`),
  KEY `idx_creator` (`creator_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `risk`
--



--
-- Table structure for table `tg_group_permission`
--

CREATE TABLE `tg_group_permission` (
  `group_name` int(11) NOT NULL default '0',
  `permission_name` int(11) NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tg_group_permission`
--



--
-- Table structure for table `tg_user_group`
--

CREATE TABLE `tg_user_group` (
  `group_name` int(11) NOT NULL default '0',
  `user_name` int(11) NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tg_user_group`
--


INSERT INTO `tg_user_group` VALUES (1,1);

--
-- Table structure for table `tg_visit`
--

CREATE TABLE `tg_visit` (
  `id` int(11) NOT NULL auto_increment,
  `visit_key` varchar(40) NOT NULL default '',
  `created` datetime default NULL,
  `expiry` datetime default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `visit_key` (`visit_key`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tg_visit`
--


INSERT INTO `tg_visit` VALUES (1,'e84dd6b42d2f8eb16bbf242aa67fc12deb5909f5','2006-05-29 13:31:40','2006-05-29 13:55:42');

--
-- Table structure for table `tg_visit_identity`
--

CREATE TABLE `tg_visit_identity` (
  `id` int(11) NOT NULL auto_increment,
  `visit_key` varchar(40) NOT NULL default '',
  `user_id` int(11) default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `visit_key` (`visit_key`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tg_visit_identity`
--



