Skip to main content

Delete a Sirius Document

Sirius employs a soft-deletion system for documents, so that they are hidden from users rather than being destroyed completely. However, this process cannot be performed through the frontend application and must be done directly in the database.

Pre-requisites

You must have access to the production operator role in AWS.

You must be able to identify precisely which document should be deleted.

Instructions

Set up and configure Cloud9

  1. Follow the instructions to create a Cloud9 instance and connect it to the environment you want to delete a document from
  2. The Cloud9 account must be in the same account as the environment (e.g. you cannot access production environments from the development account)
  3. If deleting a document from production, you may want to trial the deletion in preproduction first

Use postgres to identify the document for deletion

To soft-delete the document, you’ll need to know its ID number. This can be found by querying postgres with the information you have available.

  1. Access Postgres with the psql command. The configuration details (hostname, user, password) were set up in the previous step
  2. Identify the ID of the document by running SQL queries
  3. Verify you have the correct document with SELECT * FROM documents WHERE id = {id};

Use postgres to soft-delete the document

In Postgres, set the deleted flag on the document using its ID:

UPDATE documents SET deletedat=now() WHERE deletedat is null AND id = {id};