The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Delete a notification for a page via script?

Mihai Mihai
Contributor
July 3, 2019

Hello,

 

Due to https://jira.atlassian.com/browse/CONFSERVER-15964 we cannot purge a page as we get an error:

 

delete on table "content" violates foreign key constraint "fk594acc88c38fbea" on table "notifications"
  Detail: Key (contentid)=(182682701) is still referenced from table "notifications".


 

 

As we would like to not stop the database for something as small as this, would it be possible to delete that notification through a script? We do have scriptrunner for confluence.

 

DELETE FROM NOTIFICATIONS WHERE CONTENTID IN (SELECT CONTENTID FROM CONTENT WHERE (CONTENT_STATUS = 'deleted' AND SPACEID = <SPACEID>) OR PREVVER IN (SELECT CONTENTID FROM CONTENT WHERE CONTENT_STATUS = 'deleted' AND SPACEID = <SPACEID>));

 

It would replace the above query.

 

Thank you!

0 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

TAGS
AUG Leaders

Atlassian Community Events