   `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 ;
+  `ticket_limit` int(11) NOT NULL DEFAULT '0',
+  `notify_empty` tinyint(1) NOT NULL DEFAULT '1',
+  PRIMARY KEY (`id`),
+  KEY `board_id` (`board_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1531 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `phase_day_stat`
+--
+-- Creation: Nov 26, 2013 at 07:33 AM
+--
+
+CREATE TABLE IF NOT EXISTS `phase_day_stat` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `board_id` int(10) unsigned NOT NULL,
+  `phase` int(11) NOT NULL,
+  `num` int(11) NOT NULL,
+  `date` date NOT NULL,
+  PRIMARY KEY (`id`),
+  KEY `board_id` (`board_id`),
+  KEY `phase` (`phase`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=416845 ;
 
 -- --------------------------------------------------------
 
 --
 -- Table structure for table `phase_email_notification`
+--
+-- Creation: Nov 26, 2013 at 07:33 AM
 --
 
 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;
+  `group_id` int(10) unsigned NOT NULL,
+  UNIQUE KEY `phase_group_subscription` (`phase_id`,`group_id`),
+  KEY `group_id` (`group_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `phase_release`
+--
+-- Creation: Nov 26, 2013 at 07:33 AM
+--
+
+CREATE TABLE IF NOT EXISTS `phase_release` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `board_id` int(10) unsigned NOT NULL,
+  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
+  `released` datetime NOT NULL,
+  PRIMARY KEY (`id`),
+  KEY `board_id` (`board_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=32 ;
 
 -- --------------------------------------------------------
 
 --
 -- Table structure for table `phase_subscription`
 --
+-- Creation: Nov 26, 2013 at 07:33 AM
+--
 
 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 ;
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `phase_user_subscription` (`phase_id`,`user_id`),
+  KEY `user_id` (`user_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=221 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `release_ticket`
+--
+-- Creation: Nov 26, 2013 at 07:33 AM
+--
+
+CREATE TABLE IF NOT EXISTS `release_ticket` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `release_id` int(10) unsigned NOT NULL,
+  `ticket_id` int(10) unsigned NOT NULL,
+  PRIMARY KEY (`id`),
+  KEY `release_id` (`release_id`),
+  KEY `ticket_id` (`ticket_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1052 ;
 
 -- --------------------------------------------------------
 
 --
 -- Table structure for table `ticket`
 --
+-- Creation: Nov 26, 2013 at 08:01 AM
+--
 
 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,
+  `info` text,
+  `responsible` int(10) unsigned DEFAULT 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,
+  `reference_id` text,
   `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 ;
+  `component` int(10) unsigned DEFAULT NULL,
+  `last_change` datetime DEFAULT NULL,
+  `created` datetime DEFAULT NULL,
+  PRIMARY KEY (`id`),
+  KEY `ticket_poll` (`phase`,`active`,`deleted`),
+  KEY `board_id` (`board_id`),
+  KEY `responsible` (`responsible`),
+  KEY `component` (`component`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=24220 ;
 
 -- --------------------------------------------------------
 
 --
 -- Table structure for table `ticket_comment`
 --
+-- Creation: Nov 26, 2013 at 07:33 AM
+--
 
 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 ;
+  `data` text,
+  `created` datetime DEFAULT NULL,
+  PRIMARY KEY (`id`),
+  KEY `ticket_id` (`ticket_id`),
+  KEY `user_id` (`user_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=17034 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `ticket_email_subscription`
+--
+-- Creation: Nov 26, 2013 at 07:33 AM
+--
+
+CREATE TABLE IF NOT EXISTS `ticket_email_subscription` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `ticket_id` int(10) unsigned NOT NULL,
+  `email` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `ticket_email` (`ticket_id`,`email`),
+  KEY `ticket_id` (`ticket_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `ticket_history`
+--
+-- Creation: Nov 26, 2013 at 07:33 AM
+--
+
+CREATE TABLE IF NOT EXISTS `ticket_history` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `ticket_id` int(10) unsigned NOT NULL,
+  `user_id` int(10) unsigned NOT NULL,
+  `data` text,
+  `created` datetime DEFAULT NULL,
+  PRIMARY KEY (`id`),
+  KEY `ticket_id` (`ticket_id`),
+  KEY `user_id` (`user_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=77518 ;
 
 -- --------------------------------------------------------
 
 --
 -- Table structure for table `ticket_link`
+--
+-- Creation: Nov 26, 2013 at 07:33 AM
 --
 
 CREATE TABLE IF NOT EXISTS `ticket_link` (
   `parent` int(10) unsigned NOT NULL,
-  `child` int(10) unsigned NOT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+  `child` int(10) unsigned NOT NULL,
+  UNIQUE KEY `parent_child` (`parent`,`child`),
+  KEY `child` (`child`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 -- --------------------------------------------------------
 
 --
 -- Table structure for table `ticket_stat`
+--
+-- Creation: Nov 26, 2013 at 07:33 AM
 --
 
 CREATE TABLE IF NOT EXISTS `ticket_stat` (

-- phpMyAdmin SQL Dump
-- version 3.4.10.1deb1
-- 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

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";

  `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` (
