`id` int(11) NOT NULL auto_increment, # favorite report id
`name` varchar(200) NOT NULL, # favorite report name
`user_id` int(11) NOT NULL, # user id favorite report belongs to
+ `group_id` int(11) default NULL, # group id
+ `org_id` int(11) default NULL, # organization id
`report_spec` text default NULL, # future replacement field for all report settings
`client_id` int(11) default NULL, # client id (if selected)
`cf_1_option_id` int(11) default NULL, # custom field 1 option id (if selected)
CREATE TABLE `tt_cron` (
`id` int(11) NOT NULL auto_increment, # entry id
`group_id` int(11) NOT NULL, # group id
+ `org_id` int(11) default NULL, # organization id
`cron_spec` varchar(255) NOT NULL, # cron specification, "0 1 * * *" for "daily at 01:00"
`last` int(11) default NULL, # UNIX timestamp of when job was last run
`next` int(11) default NULL, # UNIX timestamp of when to run next job
# Structure for table tt_client_project_binds. This table maps clients to assigned projects.
#
CREATE TABLE `tt_client_project_binds` (
- `client_id` int(11) NOT NULL, # client id
- `project_id` int(11) NOT NULL # project id
+ `client_id` int(11) NOT NULL, # client id
+ `project_id` int(11) NOT NULL, # project id
+ `group_id` int(11) default NULL, # group id
+ `org_id` int(11) default NULL # organization id
);
# Indexes for tt_client_project_binds.
create index client_idx on tt_client_project_binds(client_id);
create index project_idx on tt_client_project_binds(project_id);
+create unique index client_project_idx on tt_client_project_binds(client_id, project_id);
#
#
CREATE TABLE `tt_config` (
`user_id` int(11) NOT NULL, # user id
+ `group_id` int(11) default NULL, # group id
+ `org_id` int(11) default NULL, # organization id
`param_name` varchar(32) NOT NULL, # parameter name
`param_value` varchar(80) default NULL # parameter value
);
PRIMARY KEY (`param_name`)
);
-INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.18.18', now()); # TODO: change when structure changes.
+INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.18.22', now()); # TODO: change when structure changes.