Skip to content

Commit c8adc4c

Browse files
committed
fix: remove bad post
1 parent d04e731 commit c8adc4c

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

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

0 commit comments

Comments
 (0)