X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/3510da81df216bb117f197dc69366fc564902754..191af95a641e560104be099de62ea45ac5cd6315:/mysql.sql?ds=inline

diff --git a/mysql.sql b/mysql.sql
index d5dbe410..e0c4145d 100644
--- a/mysql.sql
+++ b/mysql.sql
@@ -296,6 +296,7 @@ CREATE TABLE `tt_fav_reports` (
 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
@@ -332,13 +333,16 @@ create unique index client_name_idx on tt_clients(group_id, name, status);
 # 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);
 
 
 #
@@ -347,6 +351,8 @@ create index project_idx on tt_client_project_binds(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
 );
@@ -475,4 +481,4 @@ CREATE TABLE `tt_site_config` (
   PRIMARY KEY  (`param_name`)
 );
 
-INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.18.19', 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.
