--
-- Host: localhost    Database: ncrorgza_myt341
-- ------------------------------------------------------


--
-- Current Database: `ncrorgza_myt341`
--


--
-- Table structure for table `mt4b_android_udid`
--

CREATE TABLE `mt4b_android_udid` (
  `user_name` varchar(255) NOT NULL,
  `registration_id` varchar(255) NOT NULL,
  PRIMARY KEY (`registration_id`),
  KEY `mt4b_user_name` (`user_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `mt4b_android_udid`
--


--
-- Table structure for table `mt4b_attachment`
--

CREATE TABLE `mt4b_attachment` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `type` varchar(30) DEFAULT NULL,
  `uri` text,
  `created` date DEFAULT NULL,
  `task_id` int(11) DEFAULT NULL,
  `project_id` int(11) DEFAULT NULL,
  `mega_id` char(8) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `mega_id` (`mega_id`),
  KEY `mt4b_task_id` (`task_id`),
  KEY `mt4b_project_id` (`project_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `mt4b_attachment`
--


--
-- Table structure for table `mt4b_auth_assignment`
--

CREATE TABLE `mt4b_auth_assignment` (
  `itemname` varchar(255) NOT NULL,
  `userid` varchar(255) NOT NULL,
  `bizrule` text,
  `data` text,
  PRIMARY KEY (`itemname`,`userid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `mt4b_auth_assignment`
--

INSERT INTO `mt4b_auth_assignment` (`itemname`, `userid`, `bizrule`, `data`) VALUES ('Application Manager','1',NULL,'N;'),('Developer','1',NULL,'N;'),('Project Manager','1',NULL,'N;'),('Role Manager','1',NULL,'N;'),('Task Manager','1',NULL,'N;'),('User Manager','1',NULL,'N;');

--
-- Table structure for table `mt4b_auth_item`
--

CREATE TABLE `mt4b_auth_item` (
  `name` varchar(255) NOT NULL,
  `type` int(11) NOT NULL,
  `description` text,
  `bizrule` text,
  `data` text,
  PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `mt4b_auth_item`
--

INSERT INTO `mt4b_auth_item` (`name`, `type`, `description`, `bizrule`, `data`) VALUES ('adminAllCharge',0,'Charge Admin All',NULL,'N;'),('adminCharge',0,'Charge Admin',NULL,'N;'),('adminConfig',0,'Application Configuration Management',NULL,'N;'),('adminRole',0,'Roles Configuration Management',NULL,'N;'),('Application Manager',2,'',NULL,'N;'),('createCharge',0,'Charge Create',NULL,'N;'),('createProject',0,'Project Create',NULL,'N;'),('createTask',0,'Task Create',NULL,'N;'),('createUser',0,'User Create',NULL,'N;'),('deleteProject',0,'Project Delete',NULL,'N;'),('deleteTask',0,'Task Delete',NULL,'N;'),('deleteUser',0,'User Delete',NULL,'N;'),('Developer',2,'',NULL,'N;'),('indexAllProject',0,'Project View All',NULL,'N;'),('indexAllTask',0,'Task View All',NULL,'N;'),('indexAllUser',0,'User View All',NULL,'N;'),('Project Manager',2,'',NULL,'N;'),('Role Manager',2,'',NULL,'N;'),('Task Manager',2,'',NULL,'N;'),('updateProject',0,'Project Update',NULL,'N;'),('updateTask',0,'Task Update',NULL,'N;'),('updateUser',0,'User Update',NULL,'N;'),('User Manager',2,'',NULL,'N;');

--
-- Table structure for table `mt4b_auth_item_child`
--

CREATE TABLE `mt4b_auth_item_child` (
  `parent` varchar(255) NOT NULL,
  `child` varchar(255) NOT NULL,
  PRIMARY KEY (`parent`,`child`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `mt4b_auth_item_child`
--

INSERT INTO `mt4b_auth_item_child` (`parent`, `child`) VALUES ('Application Manager','adminAllCharge'),('Application Manager','adminConfig'),('Developer','createCharge'),('Developer','createTask'),('Developer','deleteTask'),('Developer','updateTask'),('Project Manager','adminCharge'),('Project Manager','createCharge'),('Project Manager','createProject'),('Project Manager','deleteProject'),('Project Manager','indexAllProject'),('Project Manager','updateProject'),('Role Manager','adminRole'),('Task Manager','createTask'),('Task Manager','deleteTask'),('Task Manager','indexAllTask'),('Task Manager','updateTask'),('User Manager','createUser'),('User Manager','deleteUser'),('User Manager','updateUser');

--
-- Table structure for table `mt4b_charge`
--

CREATE TABLE `mt4b_charge` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created` datetime NOT NULL,
  `created_by` int(11) NOT NULL,
  `last_upd` datetime DEFAULT NULL,
  `last_upd_by` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `project_id` int(11) DEFAULT NULL,
  `task_id` int(11) DEFAULT NULL,
  `day` date DEFAULT NULL,
  `hours` float DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `mt4b_created_by` (`created_by`),
  KEY `mt4b_last_upd_by` (`last_upd_by`),
  KEY `mt4b_user_id` (`user_id`),
  KEY `mt4b_project_id_charge` (`project_id`),
  KEY `mt4b_task_id_charge` (`task_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `mt4b_charge`
--


--
-- Table structure for table `mt4b_comment`
--

CREATE TABLE `mt4b_comment` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created` datetime NOT NULL,
  `created_by` int(11) NOT NULL,
  `last_upd` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `last_upd_by` int(11) DEFAULT NULL,
  `entity` varchar(255) NOT NULL,
  `entity_id` int(11) NOT NULL,
  `body` text,
  `status` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `mt4b_comment`
--


--
-- Table structure for table `mt4b_counter_save`
--

CREATE TABLE `mt4b_counter_save` (
  `save_name` varchar(10) NOT NULL,
  `save_value` int(11) unsigned NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `mt4b_counter_save`
--


--
-- Table structure for table `mt4b_counter_users`
--

CREATE TABLE `mt4b_counter_users` (
  `user_ip` varchar(39) NOT NULL,
  `user_time` int(11) unsigned NOT NULL,
  UNIQUE KEY `user_ip` (`user_ip`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `mt4b_counter_users`
--


--
-- Table structure for table `mt4b_project`
--

CREATE TABLE `mt4b_project` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created` datetime NOT NULL,
  `created_by` int(11) NOT NULL,
  `last_upd` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `last_upd_by` int(11) DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `prefix` varchar(3) DEFAULT NULL,
  `description` text,
  `champion_id` int(11) DEFAULT NULL,
  `status` varchar(3) DEFAULT NULL,
  `progress` smallint(5) unsigned DEFAULT NULL,
  `par_project_id` int(11) DEFAULT NULL,
  `start_date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `eff_start_date` date DEFAULT NULL,
  `eff_end_date` date DEFAULT NULL,
  `client` tinytext,
  `chargeable_flg` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `mt4b_par_project` (`par_project_id`),
  KEY `mt4b_champion` (`champion_id`),
  KEY `mt4b_created_by_project` (`created_by`),
  KEY `mt4b_status` (`status`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `mt4b_project`
--

INSERT INTO `mt4b_project` (`id`, `created`, `created_by`, `last_upd`, `last_upd_by`, `name`, `prefix`, `description`, `champion_id`, `status`, `progress`, `par_project_id`, `start_date`, `end_date`, `eff_start_date`, `eff_end_date`, `client`, `chargeable_flg`) VALUES (1,'2017-10-24 15:22:21',1,'2017-10-24 15:22:21',1,'Courses','--0',NULL,1,'4',0,NULL,NULL,NULL,NULL,NULL,NULL,1),(2,'2017-10-24 15:22:21',1,'2017-10-24 15:22:21',1,'Vacation','--1',NULL,1,'4',0,NULL,NULL,NULL,NULL,NULL,NULL,1),(3,'2017-10-24 15:22:21',1,'2017-10-24 15:22:21',1,'Public Holiday','--2',NULL,1,'4',0,NULL,NULL,NULL,NULL,NULL,NULL,1),(4,'2017-10-24 15:22:21',1,'2017-10-24 15:22:21',1,'Sick-leave','--3',NULL,1,'4',0,NULL,NULL,NULL,NULL,NULL,NULL,1);

--
-- Table structure for table `mt4b_session`
--

CREATE TABLE `mt4b_session` (
  `id` char(32) NOT NULL,
  `user_id` int(11) unsigned NOT NULL,
  `expire` int(11) DEFAULT NULL,
  `data` longblob,
  PRIMARY KEY (`id`),
  KEY `mt4b_user_id_session` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `mt4b_session`
--


--
-- Table structure for table `mt4b_task`
--

CREATE TABLE `mt4b_task` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created` datetime NOT NULL,
  `created_by` int(11) NOT NULL,
  `last_upd` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `last_upd_by` int(11) DEFAULT NULL,
  `par_project_id` int(11) NOT NULL,
  `parent_id` int(11) DEFAULT NULL,
  `title` varchar(255) NOT NULL,
  `description` text,
  `status` int(11) DEFAULT NULL,
  `progress` smallint(5) unsigned DEFAULT NULL,
  `start_date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `eff_start_date` date DEFAULT NULL,
  `eff_end_date` date DEFAULT NULL,
  `priority` smallint(6) DEFAULT NULL,
  `type` smallint(6) DEFAULT NULL,
  `private_flg` tinyint(1) NOT NULL DEFAULT '0',
  `chargeable_flg` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `mt4b_task_ibfk_3` (`parent_id`),
  KEY `mt4b_task_ibfk_2` (`created_by`),
  KEY `mt4b_task_ibfk_1` (`par_project_id`),
  KEY `mt4b_title` (`title`,`par_project_id`),
  KEY `mt4b_status_task` (`status`),
  KEY `mt4b_type` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `mt4b_task`
--


--
-- Table structure for table `mt4b_task_status`
--

CREATE TABLE `mt4b_task_status` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(30) NOT NULL,
  `group_id` int(11) unsigned NOT NULL,
  `order_by` int(11) unsigned NOT NULL,
  `default_flg` tinyint(1) DEFAULT NULL,
  `active_flg` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `mt4b_task_status`
--

INSERT INTO `mt4b_task_status` (`id`, `name`, `group_id`, `order_by`, `default_flg`, `active_flg`) VALUES (1,'Open',0,0,1,1),(2,'Working On',0,1,0,1),(3,'Suspended',2,2,0,1),(4,'Closed',1,3,0,1),(5,'Cancelled',1,4,0,1);

--
-- Table structure for table `mt4b_task_type`
--

CREATE TABLE `mt4b_task_type` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(30) NOT NULL,
  `order_by` int(11) unsigned NOT NULL,
  `default_flg` tinyint(1) DEFAULT NULL,
  `active_flg` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `mt4b_task_type`
--

INSERT INTO `mt4b_task_type` (`id`, `name`, `order_by`, `default_flg`, `active_flg`) VALUES (1,'Bug',0,0,1),(2,'Enhancement',1,0,1),(3,'Task',2,1,1);

--
-- Table structure for table `mt4b_user_project`
--

CREATE TABLE `mt4b_user_project` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created` datetime NOT NULL,
  `last_upd` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `user_id` int(11) NOT NULL,
  `project_id` int(11) NOT NULL,
  `rollon_date` date DEFAULT NULL,
  `rolloff_date` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`,`project_id`),
  KEY `mt4b_user_project_ibfk_2` (`project_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `mt4b_user_project`
--

INSERT INTO `mt4b_user_project` (`id`, `created`, `last_upd`, `user_id`, `project_id`, `rollon_date`, `rolloff_date`) VALUES (1,'2017-10-24 15:22:21','2017-10-24 15:22:21',1,1,'2017-10-24',NULL),(2,'2017-10-24 15:22:21','2017-10-24 15:22:21',1,2,'2017-10-24',NULL),(3,'2017-10-24 15:22:21','2017-10-24 15:22:21',1,3,'2017-10-24',NULL),(4,'2017-10-24 15:22:21','2017-10-24 15:22:21',1,4,'2017-10-24',NULL);

--
-- Table structure for table `mt4b_user_task`
--

CREATE TABLE `mt4b_user_task` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created` datetime NOT NULL,
  `last_upd` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `user_id` int(11) NOT NULL,
  `task_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`,`task_id`),
  KEY `mt4b_user_task_ibfk_2` (`task_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `mt4b_user_task`
--


--
-- Dumping events for database 'ncrorgza_myt341'
--

--
-- Dumping routines for database 'ncrorgza_myt341'
--


