 -- phpMyAdmin SQL Dump
--- version 3.4.10.1deb1
+-- version 3.5.8
 -- http://www.phpmyadmin.net
 --
 -- Host: localhost
--- Generation Time: Jun 20, 2012 at 11:54 AM
--- Server version: 5.5.22
--- PHP Version: 5.3.10-1ubuntu3.1
+-- Generation Time: Aug 12, 2014 at 04:22 PM
+-- Server version: 5.1.73-log
+-- PHP Version: 5.3.3
 
 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
 SET time_zone = "+00:00";

  `active` tinyint(1) NOT NULL DEFAULT '1',
  `force_comment` varchar(64) DEFAULT NULL,
  `wip_limit` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `phase_email_notification`
--

CREATE TABLE IF NOT EXISTS `phase_email_notification` (
  `phase_id` int(11) NOT NULL,
  `group_id` int(10) unsigned NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `phase_subscription`
--

CREATE TABLE IF NOT EXISTS `phase_subscription` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `phase_id` int(11) NOT NULL,
  `user_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `ticket`
--

CREATE TABLE IF NOT EXISTS `ticket` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `board_id` int(10) unsigned NOT NULL,
  `data` varchar(255) NOT NULL,
  `responsible` int(10) unsigned NOT NULL,
  `wip` int(11) DEFAULT NULL,
  `cycle` int(10) unsigned NOT NULL DEFAULT '0',
  `phase` int(11) NOT NULL,
  `priority` int(11) DEFAULT '0',
  `reference_id` varchar(255) DEFAULT NULL,
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `component` int(10) unsigned NOT NULL,
  `last_change` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `created` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `ticket_comment`
--

CREATE TABLE IF NOT EXISTS `ticket_comment` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ticket_id` int(10) unsigned NOT NULL,
  `user_id` int(10) unsigned NOT NULL,
  `data` varchar(255) DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `ticket_link`
--

CREATE TABLE IF NOT EXISTS `ticket_link` (
  `parent` int(10) unsigned NOT NULL,
  `child` int(10) unsigned NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `ticket_stat`
--

CREATE TABLE IF NOT EXISTS `ticket_stat` (

  `url` text,
  `email` varchar(255) DEFAULT NULL,
  `timezone` varchar(255) DEFAULT 'Europe/Helsinki',
  `created` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=170 ;

-- --------------------------------------------------------

--
-- Table structure for table `board_activity_stat`
--
-- Creation: Nov 26, 2013 at 07:49 AM
--

CREATE TABLE IF NOT EXISTS `board_activity_stat` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `board_id` int(10) unsigned NOT NULL,
  `num` int(11) NOT NULL,
  `date` date NOT NULL,
  PRIMARY KEY (`id`),
  KEY `board_id` (`board_id`),
  KEY `date` (`date`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=58189 ;

-- --------------------------------------------------------

--
-- Table structure for table `board_setting`
--
-- Creation: Nov 26, 2013 at 07:49 AM
--

CREATE TABLE IF NOT EXISTS `board_setting` (
  `board_id` int(10) unsigned NOT NULL,
  `data` varchar(255) DEFAULT NULL,
  `value` varchar(255) DEFAULT '0',
  UNIQUE KEY `board_setting` (`board_id`,`data`),
  KEY `data` (`data`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `component`
--
-- Creation: Nov 26, 2013 at 07:33 AM
--

CREATE TABLE IF NOT EXISTS `component` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `board_id` int(10) unsigned DEFAULT NULL,
  `name` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `board_id` (`board_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=575 ;

-- --------------------------------------------------------

--
-- Table structure for table `cycle`
--
-- Creation: Nov 26, 2013 at 07:50 AM
--

CREATE TABLE IF NOT EXISTS `cycle` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `board_id` int(10) unsigned NOT NULL,
  `data` varchar(255) DEFAULT NULL,
  `start` datetime DEFAULT NULL,
  `stop` datetime DEFAULT NULL,
  `wip_limit` int(11) DEFAULT NULL,
  `active` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `board_id` (`board_id`),
  KEY `start` (`start`),
  KEY `active` (`active`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=203 ;

-- --------------------------------------------------------

--
-- Table structure for table `cycle_stat`
--
-- Creation: Nov 26, 2013 at 07:33 AM
--

CREATE TABLE IF NOT EXISTS `cycle_stat` (
  `cycle_id` int(10) unsigned NOT NULL,
  `phase_id` int(11) NOT NULL,
  `wip` int(11) NOT NULL,
  `created` datetime DEFAULT NULL,
  KEY `cycle_phase` (`cycle_id`,`phase_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `group_permission`
--
-- Creation: Nov 26, 2013 at 07:33 AM
--

CREATE TABLE IF NOT EXISTS `group_permission` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `permission_id` int(10) unsigned NOT NULL,
  `group_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `group_permission` (`permission_id`,`group_id`),
  KEY `group_id` (`group_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=414 ;

-- --------------------------------------------------------

--
-- Table structure for table `log`
--
-- Creation: Nov 26, 2013 at 07:33 AM
--

CREATE TABLE IF NOT EXISTS `log` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `board_id` int(10) unsigned NOT NULL,
  `data` longtext,
  `date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `board_id` (`board_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=148276 ;

-- --------------------------------------------------------

--
-- Table structure for table `message`
--
-- Creation: Nov 26, 2013 at 07:33 AM
--

CREATE TABLE IF NOT EXISTS `message` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `topic_id` int(11) NOT NULL,
  `user_id` int(10) unsigned DEFAULT NULL,
  `message` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
  `time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `topic_id` (`topic_id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=21 ;

-- --------------------------------------------------------

--
-- Table structure for table `message_topic`
--
-- Creation: Nov 26, 2013 at 07:33 AM
--

CREATE TABLE IF NOT EXISTS `message_topic` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `board_id` int(10) unsigned NOT NULL,
  `user_id` int(10) unsigned DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
  `created` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `board_id` (`board_id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=28 ;

-- --------------------------------------------------------

--
-- Table structure for table `pagegen`
--
-- Creation: Nov 26, 2013 at 07:33 AM
--

CREATE TABLE IF NOT EXISTS `pagegen` (
  `board_id` int(10) unsigned NOT NULL,
  `id` int(11) DEFAULT NULL,
  PRIMARY KEY (`board_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `permission`
--
-- Creation: Dec 12, 2013 at 07:12 AM
--

CREATE TABLE IF NOT EXISTS `permission` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `data` varchar(45) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  UNIQUE KEY `data` (`data`),
  KEY `data_2` (`data`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=21 ;

-- --------------------------------------------------------

--
-- Table structure for table `personal_setting`
--
-- Creation: Nov 26, 2013 at 07:33 AM
--

CREATE TABLE IF NOT EXISTS `personal_setting` (
  `user_id` int(10) unsigned NOT NULL,
  `setting` varchar(255) DEFAULT NULL,
  `value` varchar(255) DEFAULT NULL,
  UNIQUE KEY `user_setting` (`user_id`,`setting`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `phase`
--
-- Creation: Nov 26, 2013 at 07:33 AM
--

CREATE TABLE IF NOT EXISTS `phase` (
