-
Bug
-
Resolution: Fixed
-
Medium
-
5.6, 5.7, 5.8
NOTE: Should you're still seeing this issue in your Confluence instance (version 5.9.1 and above), please refer to the bug - CONFSERVER-58261: Missing unique constraints and index in fresh Confluence installation for further details.
Summary
When installing Confluence from scratch, additional constraints are not being added.
Environment
- PostgreSQL is being used as the database
Steps to Reproduce
- Configure PostgreSQL as per Database Setup for PostgreSQL
- Install Confluence as per Confluence Installation Guide
Expected Results
The following constraints/indexes should exist on the tables:
cwd_group:
- cwd_group_name_dir_id
cwd_user:
- cwd_user_name_dir_id
cwd_membership:
- cwd_unique_user_membership
- cwd_unique_group_membership
cwd_group_attribute:
- cwd_unique_grp_attr unique
cwd_user_attribute:
- cwd_unique_usr_attr unique
content_perm:
- cp_unique_user
- cp_unique_group
content_perm_set:
- cps_unique_type
bandana:
- bandana_unique_key
os_propertyentry:
- ospe_entityid_idx
Actual Results
The above mentioned constraints are not present in the database.
Workaround
WARNING: Make sure to back up the database before applying any SQL commands that modify the database, and ensure Confluence is not running while applying the change
For PostgreSQL, you can run the below SQL statements to add the missing constraints and indexes, assuming that the constraints haven't been broken in the mean time:
-- Embedded Crowd constraints alter table cwd_group add constraint cwd_group_name_dir_id unique (lower_group_name, directory_id); alter table cwd_user add constraint cwd_user_name_dir_id unique (lower_user_name, directory_id); alter table cwd_membership add constraint cwd_unique_user_membership unique (parent_id, child_user_id); alter table cwd_membership add constraint cwd_unique_group_membership unique (parent_id, child_group_id); alter table cwd_group_attribute add constraint cwd_unique_grp_attr unique (directory_id, group_id, attribute_name, attribute_lower_value); alter table cwd_user_attribute add constraint cwd_unique_usr_attr unique (directory_id, user_id, attribute_name, attribute_lower_value); -- Content Permission constraints alter table CONTENT_PERM add constraint cp_unique_user unique (CPS_ID, CP_TYPE, USERNAME); alter table CONTENT_PERM add constraint cp_unique_group unique (CPS_ID, CP_TYPE, GROUPNAME); alter table CONTENT_PERM_SET add constraint cps_unique_type unique (CONTENT_ID, CONT_PERM_TYPE); -- Bandana constraints alter table BANDANA add constraint bandana_unique_key unique (BANDANACONTEXT, BANDANAKEY); -- Property Entry index create index ospe_entityid_idx on OS_PROPERTYENTRY (entity_id);
- is related to
-
CONFSERVER-30050 Users are duplicated in the People Directory, shares, mentions, and have two USERINFO records in the database
- Closed
- relates to
-
CONFSERVER-58261 Missing unique constraints and index in certain fresh Confluence installation
- Closed
- included in
-
CPU-234 Confluence 6.0.0-OD-2016.04.1-0001
-
CPU-247 Confluence 6.0.0-OD-2016.04.1-0003
-
CPU-250 Confluence 6.0.0-OD-2016.04.1-0004
- mentioned in
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...