From 5a497691fd713ec08839914f5e92efe49149ddb6 Mon Sep 17 00:00:00 2001 From: Karl Essinger Date: Sun, 6 Dec 2020 18:54:03 +0100 Subject: [PATCH] Fixed another bug if a channel was not properly deleted on close --- SupportBoi/Database.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SupportBoi/Database.cs b/SupportBoi/Database.cs index dad77ba..74759a6 100644 --- a/SupportBoi/Database.cs +++ b/SupportBoi/Database.cs @@ -312,8 +312,9 @@ public static void ArchiveTicket(Ticket ticket) { using (MySqlConnection c = GetConnection()) { - MySqlCommand deleteTicket = new MySqlCommand(@"DELETE FROM ticket_history WHERE id=@id", c); + MySqlCommand deleteTicket = new MySqlCommand(@"DELETE FROM ticket_history WHERE id=@id OR channel_id=@channel_id", c); deleteTicket.Parameters.AddWithValue("@id", ticket.id); + deleteTicket.Parameters.AddWithValue("@channel_id", ticket.channelID); c.Open(); deleteTicket.Prepare();