Skip to content

Commit 1f45602

Browse files
committed
fix: remove bad post
1 parent 6b88162 commit 1f45602

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using FruityFoundation.DataAccess.Abstractions;
2+
3+
namespace WebApi.Scripts;
4+
5+
/// <summary>
6+
/// Script_2025_07_21T20_46_RemoveBadPostIds
7+
/// </summary>
8+
public class Script_2025_07_21T20_46_RemoveBadPostIds : IDbMaintenanceScript
9+
{
10+
/// <inheritdoc />
11+
public async Task Run(IDatabaseConnection<ReadWrite> dbConnection)
12+
{
13+
string[] postIds = [
14+
"1m4njv1",
15+
];
16+
17+
foreach (var postId in postIds)
18+
{
19+
await dbConnection.Execute(
20+
"""
21+
BEGIN TRANSACTION;
22+
DELETE FROM reddit_comments WHERE reddit_post_id = @postId;
23+
DELETE FROM link_queue WHERE reddit_post_id = @postId;
24+
DELETE FROM links WHERE reddit_post_id = @postId;
25+
COMMIT;
26+
""", new { postId }, CancellationToken.None);
27+
}
28+
}
29+
}

0 commit comments

Comments
 (0)