X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=mysql.sql;h=a69387b384c487758539321d6aed43c77a4b7262;hb=ad98b13400fdc2fa2299a22c9bd54c4cd27960c3;hp=3c52aefc439371e80256789c7c3dcd150590f078;hpb=73d14da2b2bf18a91937cf08ee3da6e62f2d01e0;p=timetracker.git diff --git a/mysql.sql b/mysql.sql index 3c52aefc..a69387b3 100644 --- a/mysql.sql +++ b/mysql.sql @@ -386,18 +386,24 @@ ALTER TABLE `tt_monthly_quotas` # Structure for table tt_roles. This table stores customized team roles. # CREATE TABLE `tt_roles` ( - `id` int(11) NOT NULL auto_increment, # role id - `team_id` int(11) NOT NULL, # team id - `name` varchar(80) default NULL, # role name - may be used to rename standard roles - `rank` int(11) default 0, # Role rank and identifier in comparison with other roles, - # used to determine what "lesser roles" are - # and also identifies a role within a team, used as role in tt_users. - `rights` text default NULL, # Comma-separated list of rights assigned to a role. - # NULL here for predefined roles (4, 16, 68, 324 - manager) - # means a hard-coded set of default access rights. - `status` tinyint(4) default 1, # role status + `id` int(11) NOT NULL auto_increment, # Role id. Identifies roles for all groups on the server. + `team_id` int(11) NOT NULL, # Team id the role is defined for. + `name` varchar(80) default NULL, # Role name - custom role name. In case we are editing a + # predefined role (USER, etc.), we can rename the role here. + `description` varchar(255) default NULL, # Role description. + `rank` int(11) default 0, # Role rank, an integer value between 0-324. Predefined role ranks: + # USER - 4, CLIENT - 16, COMANAGER - 68, MANAGER - 324. + # Rank is used to determine what "lesser roles" are in each group + # for sutuations such as "manage_users". + # It also identifies a role within a team (by its "rank"). + # Value of rank is to be used in role field in tt_users table, + # just like standard roles now. + `rights` text default NULL, # Comma-separated list of rights assigned to a role. + # NULL here for predefined roles (4, 16, 68, 324 - manager) + # means a hard-coded set of default access rights. + `status` tinyint(4) default 1, # Role status. PRIMARY KEY (`id`) ); -# Create an index that guarantees unique active and inactive role ranks per team. +# Create an index that guarantees unique active and inactive role ranks in each group. create unique index role_idx on tt_roles(team_id, rank, status);