def deleteAGParticipantSurvey(self, ag_login_id, participant_name):
        # Remove user from new schema
        with TRN:
            sql = """SELECT survey_id, participant_email
                     FROM ag_login_surveys
                     JOIN ag_consent USING (ag_login_id, participant_name)
                     WHERE ag_login_id = %s AND participant_name = %s"""
            TRN.add(sql, (ag_login_id, participant_name))

            # collect all survey_ids and participant_names, since at least the
            # former might be more than one.
            survey_ids = set()
            participant_emails = set()
            for hit in TRN.execute_fetchindex():
                survey_ids.add(hit[0])
                participant_emails.add(hit[1])

            sql = """SELECT barcode
                     FROM ag.source_barcodes_surveys
                     WHERE survey_id IN %s"""
            TRN.add(sql, [tuple(survey_ids)])
            barcodes = [x[0] for x in TRN.execute_fetchindex()]

            sql = "DELETE FROM survey_answers WHERE survey_id IN %s"
            TRN.add(sql, [tuple(survey_ids)])

            sql = "DELETE FROM survey_answers_other WHERE survey_id IN %s"
            TRN.add(sql, [tuple(survey_ids)])

            # Reset survey attached to barcode(s)
            for info in self.getParticipantSamples(ag_login_id,
                                                   participant_name):
                self.deleteSample(info['barcode'], ag_login_id)

            # Delete last due to foreign keys
            sql = """DELETE FROM ag.source_barcodes_surveys
                     WHERE survey_id IN %s"""
            TRN.add(sql, [tuple(survey_ids)])
            if len(barcodes) != 0:
                # only delete barcode information, if this is the
                # last survey for the given source, i.e. ag_login_id,
                # participant_name combination
                if len(survey_ids) == 1:
                    sql = """DELETE FROM ag.ag_kit_barcodes
                             WHERE barcode IN %s"""
                    TRN.add(sql, [tuple(barcodes)])

            sql = "DELETE FROM ag_login_surveys WHERE survey_id IN %s"
            TRN.add(sql, [tuple(survey_ids)])

            sql = """DELETE FROM ag_consent
                     WHERE ag_login_id = %s AND participant_name = %s"""
            TRN.add(sql, [ag_login_id, participant_name])

            # checks if user has previously been
            # removed and is has still revoked consent
            sql = """SELECT ag_login_id FROM ag.consent_revoked"""
            TRN.add(sql)
            revoked = {result[0] for result in TRN.execute_fetchindex()}

            # only inserts to ag.consent_revoked if not already there
            if ag_login_id not in revoked:
                sql = """INSERT INTO ag.consent_revoked
                         (ag_login_id, participant_name, participant_email)
                         VALUES (%s, %s, %s)"""
                sql_args = [[ag_login_id, participant_name, pemail]
                            for pemail in participant_emails]
                TRN.add(sql, sql_args, many=True)
            TRN.execute()