Mattermost, Inc.

Delete all posts containing a string (mysql)

I’m trying to delete all posts from a specific channel that contain a specific string. I’ve identified the select statement that I need to find all the posts within the channel that contain the string.

I’m just wondering if it’s as easy as doing a DELETE instead of a SELECT or is there more to it than that?

Here is the select statement:
select * from Posts where ChannelId=‘akixfyrzxj89idfq4jaaiukb4h’ AND Message LIKE ‘%Uknown trap%’;

Can anyone confirm that this will work as expected or are there other tables/rows that need to be considered before deleting?

Brad