+ PRIMARY KEY (`group_id`,`year`,`month`)
+);
+
+
+#
+# Structure for table tt_timesheets. This table keeps timesheet related information.
+#
+CREATE TABLE `tt_timesheets` (
+ `id` int(11) NOT NULL auto_increment, # timesheet id
+ `user_id` int(11) NOT NULL, # user id
+ `group_id` int(11) default NULL, # group id
+ `org_id` int(11) default NULL, # organization id
+ `client_id` int(11) default NULL, # client id
+ `project_id` int(11) default NULL, # project id
+ `name` varchar(80) COLLATE utf8mb4_bin NOT NULL, # timesheet name
+ `comment` text, # timesheet comment
+ `start_date` date NOT NULL, # timesheet start date
+ `end_date` date NOT NULL, # timesheet end date
+ `submit_status` tinyint(4) default NULL, # submit status
+ `approve_status` tinyint(4) default NULL, # approve status
+ `approve_comment` text, # approve comment
+ `created` datetime default NULL, # creation timestamp
+ `created_ip` varchar(45) default NULL, # creator ip
+ `created_by` int(11) default NULL, # creator user_id
+ `modified` datetime default NULL, # modification timestamp
+ `modified_ip` varchar(45) default NULL, # modifier ip
+ `modified_by` int(11) default NULL, # modifier user_id
+ `status` tinyint(4) default 1, # timesheet status
+ PRIMARY KEY (`id`)
+);
+
+
+#
+# Structure for table tt_templates.
+# This table keeps templates used in groups.
+#
+CREATE TABLE `tt_templates` (
+ `id` int(11) NOT NULL auto_increment, # template id
+ `group_id` int(11) default NULL, # group id
+ `org_id` int(11) default NULL, # organization id
+ `name` varchar(80) COLLATE utf8mb4_bin NOT NULL, # template name
+ `description` varchar(255) default NULL, # template description
+ `content` text, # template content
+ `created` datetime default NULL, # creation timestamp
+ `created_ip` varchar(45) default NULL, # creator ip
+ `created_by` int(11) default NULL, # creator user_id
+ `modified` datetime default NULL, # modification timestamp
+ `modified_ip` varchar(45) default NULL, # modifier ip
+ `modified_by` int(11) default NULL, # modifier user_id
+ `status` tinyint(4) default 1, # template status
+ PRIMARY KEY (`id`)
+);
+
+
+#
+# Structure for table tt_files.
+# This table keeps file attachment information.
+#
+CREATE TABLE `tt_files` (
+ `id` int(10) unsigned NOT NULL auto_increment, # file id
+ `group_id` int(10) unsigned, # group id
+ `org_id` int(10) unsigned, # organization id
+ `remote_id` bigint(20) unsigned, # file id in storage facility
+ `file_key` varchar(32), # file key
+ `entity_type` varchar(32), # type of entity file is associated with (project, task, etc.)
+ `entity_id` int(10) unsigned, # entity id
+ `file_name` varchar(80) COLLATE utf8mb4_bin NOT NULL, # file name
+ `description` varchar(255) default NULL, # file description
+ `created` datetime default NULL, # creation timestamp
+ `created_ip` varchar(45) default NULL, # creator ip
+ `created_by` int(10) unsigned, # creator user_id
+ `modified` datetime default NULL, # modification timestamp
+ `modified_ip` varchar(45) default NULL, # modifier ip
+ `modified_by` int(10) unsigned, # modifier user_id
+ `status` tinyint(1) default 1, # file status
+ PRIMARY KEY (`id`)
+);
+
+
+#
+# Structure for table tt_work_currencies.
+# This table keeps currencies supported by remote work plugin.
+#
+CREATE TABLE `tt_work_currencies` (
+ `id` int(10) unsigned NOT NULL, # currency id
+ `name` varchar(10) NOT NULL, # currency name (USD, CAD, etc.)
+ PRIMARY KEY (`id`)
+);
+
+# Create an index that guarantees unique work currencies.
+create unique index currency_idx on tt_work_currencies(`name`);
+
+INSERT INTO `tt_work_currencies` (`id`, `name`) VALUES ('1', 'USD'), ('2', 'CAD'), ('3', 'AUD'), ('4', 'EUR'), ('5', 'NZD');
+
+
+#
+# Structure for table tt_work_categories.
+# This table keeps work categories supported by remote work plugin.
+#
+CREATE TABLE `tt_work_categories` (
+ `id` int(10) unsigned NOT NULL, # Category id.
+ `parents` text default NULL, # Comma-separated list of parent ids associated with this category.
+ `name` varchar(64) NOT NULL, # English category name.
+ `name_localized` text default NULL, # Comma-separated list of localized category names in other languages.
+ # Example: es:Codificación,ru:Кодирование.
+ PRIMARY KEY (`id`)