How to Reset Team Calendar Subscription of a User
Problem
You are an administrator of Confluence and you want to remove all calendar subscriptions from a user.
Resolution
Please back up your database before making any of the changes below. Please note that this is not supported and it is only meant to be a guide.
In order to delete all calendar subscriptions of a single user:
- Shut down Confluence
Find the
user_key
of the user by executing the SQL:SELECT * FROM user_mapping WHERE username = '<username>';
Take note of the
user_key
columnExecute the DELETE SQL query below. Replace CREATOR values with the user_key values obtained from step 2:
DELETE FROM "AO_950DC3_TC_SUBCALS" WHERE "CREATOR" = '<user_key>' AND "SUBSCRIPTION_ID" IS NOT NULL;
This will remove all subscriptions to calendars other than the calendar that the user created on its own.
If you get an FK violation error for '
fk_ao_950dc3_tc_subcals_parent_id
' while running the above query, please try the below alternative as it removes the records that have FK relation through the 'PARENT_ID
' column then proceeds with the deletion of parent records:DELETE FROM "AO_950DC3_TC_SUBCALS" WHERE "CREATOR" = '<user_key>' AND "SUBSCRIPTION_ID" IS NOT NULL AND "PARENT_ID" IS NOT NULL; DELETE FROM "AO_950DC3_TC_SUBCALS" WHERE "CREATOR" = '<user_key>' AND "SUBSCRIPTION_ID" IS NOT NULL AND "PARENT_ID" IS NULL;
- Start Confluence