-- MySQL dump 10.11
--
-- Host: localhost    Database: jtrac
-- ------------------------------------------------------
-- Server version	5.0.51a-3ubuntu5.7

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `attachments`
--

DROP TABLE IF EXISTS `attachments`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `attachments` (
  `id` bigint(20) NOT NULL auto_increment,
  `previous_id` bigint(20) default NULL,
  `file_name` varchar(255) default NULL,
  `file_prefix` bigint(20) default NULL,
  `item_id` bigint(20) default NULL,
  PRIMARY KEY  (`id`),
  KEY `FKD3F3CBB0B57E4540` (`item_id`),
  KEY `FKD3F3CBB0761CC46C` (`previous_id`)
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `config`
--

DROP TABLE IF EXISTS `config`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `config` (
  `param` varchar(255) NOT NULL,
  `value` varchar(255) default NULL,
  PRIMARY KEY  (`param`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `history`
--

DROP TABLE IF EXISTS `history`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `history` (
  `id` bigint(20) NOT NULL auto_increment,
  `version` int(11) NOT NULL,
  `type` int(11) default NULL,
  `item_id` bigint(20) NOT NULL,
  `actual_effort` double default NULL,
  `attachment_id` bigint(20) default NULL,
  `comment` text,
  `time_stamp` datetime default NULL,
  `logged_by` bigint(20) NOT NULL,
  `assigned_to` bigint(20) default NULL,
  `summary` varchar(255) default NULL,
  `detail` text,
  `status` int(11) default NULL,
  `severity` int(11) default NULL,
  `priority` int(11) default NULL,
  `cus_dbl_01` double default NULL,
  `cus_dbl_02` double default NULL,
  `cus_dbl_03` double default NULL,
  `cus_int_01` int(11) default NULL,
  `cus_int_02` int(11) default NULL,
  `cus_int_03` int(11) default NULL,
  `cus_int_04` int(11) default NULL,
  `cus_int_05` int(11) default NULL,
  `cus_int_06` int(11) default NULL,
  `cus_int_07` int(11) default NULL,
  `cus_int_08` int(11) default NULL,
  `cus_int_09` int(11) default NULL,
  `cus_int_10` int(11) default NULL,
  `cus_str_01` varchar(255) default NULL,
  `cus_str_02` varchar(255) default NULL,
  `cus_str_03` varchar(255) default NULL,
  `cus_str_04` varchar(255) default NULL,
  `cus_str_05` varchar(255) default NULL,
  `cus_tim_01` datetime default NULL,
  `cus_tim_02` datetime default NULL,
  `cus_tim_03` datetime default NULL,
  PRIMARY KEY  (`id`),
  KEY `FK373FE4949F34E6BD` (`assigned_to`),
  KEY `FK373FE494CD057065` (`logged_by`),
  KEY `FK373FE494B57E4540` (`item_id`),
  KEY `FK373FE494584066C0` (`attachment_id`)
) ENGINE=MyISAM AUTO_INCREMENT=55 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `item_items`
--

DROP TABLE IF EXISTS `item_items`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `item_items` (
  `id` bigint(20) NOT NULL auto_increment,
  `item_id` bigint(20) NOT NULL,
  `related_item_id` bigint(20) NOT NULL,
  `type` int(11) default NULL,
  PRIMARY KEY  (`id`),
  KEY `FK8B19EB94B57E4540` (`item_id`),
  KEY `FK8B19EB94AF302D2C` (`related_item_id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `item_tags`
--

DROP TABLE IF EXISTS `item_tags`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `item_tags` (
  `id` bigint(20) NOT NULL auto_increment,
  `tag_id` bigint(20) NOT NULL,
  `type` int(11) default NULL,
  `item_id` bigint(20) default NULL,
  PRIMARY KEY  (`id`),
  KEY `FK806065C5B57E4540` (`item_id`),
  KEY `FK806065C5AC3A5E54` (`tag_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `item_users`
--

DROP TABLE IF EXISTS `item_users`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `item_users` (
  `id` bigint(20) NOT NULL auto_increment,
  `user_id` bigint(20) NOT NULL,
  `type` int(11) default NULL,
  `item_id` bigint(20) default NULL,
  PRIMARY KEY  (`id`),
  KEY `FK8BC291DCB57E4540` (`item_id`),
  KEY `FK8BC291DC2E9BEA40` (`user_id`)
) ENGINE=MyISAM AUTO_INCREMENT=29 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `items`
--

DROP TABLE IF EXISTS `items`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `items` (
  `id` bigint(20) NOT NULL auto_increment,
  `version` int(11) NOT NULL,
  `type` int(11) default NULL,
  `parent_id` bigint(20) default NULL,
  `space_id` bigint(20) NOT NULL,
  `sequence_num` bigint(20) default NULL,
  `time_stamp` datetime default NULL,
  `planned_effort` double default NULL,
  `logged_by` bigint(20) NOT NULL,
  `assigned_to` bigint(20) default NULL,
  `summary` varchar(255) default NULL,
  `detail` text,
  `status` int(11) default NULL,
  `severity` int(11) default NULL,
  `priority` int(11) default NULL,
  `cus_dbl_01` double default NULL,
  `cus_dbl_02` double default NULL,
  `cus_dbl_03` double default NULL,
  `cus_int_01` int(11) default NULL,
  `cus_int_02` int(11) default NULL,
  `cus_int_03` int(11) default NULL,
  `cus_int_04` int(11) default NULL,
  `cus_int_05` int(11) default NULL,
  `cus_int_06` int(11) default NULL,
  `cus_int_07` int(11) default NULL,
  `cus_int_08` int(11) default NULL,
  `cus_int_09` int(11) default NULL,
  `cus_int_10` int(11) default NULL,
  `cus_str_01` varchar(255) default NULL,
  `cus_str_02` varchar(255) default NULL,
  `cus_str_03` varchar(255) default NULL,
  `cus_str_04` varchar(255) default NULL,
  `cus_str_05` varchar(255) default NULL,
  `cus_tim_01` datetime default NULL,
  `cus_tim_02` datetime default NULL,
  `cus_tim_03` datetime default NULL,
  PRIMARY KEY  (`id`),
  KEY `FK5FDE7C09F34E6BD` (`assigned_to`),
  KEY `FK5FDE7C0CD057065` (`logged_by`),
  KEY `FK5FDE7C02EAA8854` (`space_id`),
  KEY `FK5FDE7C0B2C23C49` (`parent_id`)
) ENGINE=MyISAM AUTO_INCREMENT=32 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `metadata`
--

DROP TABLE IF EXISTS `metadata`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `metadata` (
  `id` bigint(20) NOT NULL auto_increment,
  `version` int(11) NOT NULL,
  `type` int(11) default NULL,
  `name` varchar(50) default NULL,
  `description` text,
  `parent_id` bigint(20) default NULL,
  `xml_string` text,
  PRIMARY KEY  (`id`),
  KEY `FKE52D7B2FD9D39965` (`parent_id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `space_sequence`
--

DROP TABLE IF EXISTS `space_sequence`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `space_sequence` (
  `id` bigint(20) NOT NULL,
  `next_seq_num` bigint(20) default NULL,
  PRIMARY KEY  (`id`),
  KEY `FK5847EDAB4A0FA7B` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `spaces`
--

DROP TABLE IF EXISTS `spaces`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `spaces` (
  `id` bigint(20) NOT NULL auto_increment,
  `version` int(11) NOT NULL,
  `type` int(11) default NULL,
  `prefix_code` varchar(10) default NULL,
  `name` varchar(50) default NULL,
  `description` text,
  `guest_allowed` bit(1) default NULL,
  `metadata_id` bigint(20) default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `prefix_code` (`prefix_code`),
  KEY `FKCA95302D6205CC0` (`metadata_id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `tags`
--

DROP TABLE IF EXISTS `tags`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `tags` (
  `id` bigint(20) NOT NULL auto_increment,
  `type` int(11) default NULL,
  `name` varchar(255) NOT NULL,
  `description` text,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `user_space_roles`
--

DROP TABLE IF EXISTS `user_space_roles`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `user_space_roles` (
  `id` bigint(20) NOT NULL auto_increment,
  `user_id` bigint(20) default NULL,
  `space_id` bigint(20) default NULL,
  `role_key` varchar(255) NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `FK474D77D02EAA8854` (`space_id`),
  KEY `FK474D77D02E9BEA40` (`user_id`)
) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `users`
--

DROP TABLE IF EXISTS `users`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `users` (
  `id` bigint(20) NOT NULL auto_increment,
  `type` int(11) default NULL,
  `parent` bigint(20) default NULL,
  `login_name` varchar(50) NOT NULL,
  `name` varchar(50) default NULL,
  `password` varchar(255) default NULL,
  `email` varchar(50) default NULL,
  `locale` varchar(20) default NULL,
  `locked` bit(1) default NULL,
  `metadata_id` bigint(20) default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `login_name` (`login_name`),
  KEY `FK6A68E086205CC0` (`metadata_id`),
  KEY `FK6A68E08FC0C04DB` (`parent`)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2010-09-30 17:39:42
