diff --git a/tg_parser/internal/adapter/database/get_channels_with_tracked_posts.go b/tg_parser/internal/adapter/database/get_channels_with_tracked_posts.go index fcbb055..6b7fdc8 100644 --- a/tg_parser/internal/adapter/database/get_channels_with_tracked_posts.go +++ b/tg_parser/internal/adapter/database/get_channels_with_tracked_posts.go @@ -19,7 +19,8 @@ func (d *Database) GetChannelsWithTrackedPosts(ctx context.Context) ([]domain.Ch c.access_hash, c.pts FROM channel c -INNER JOIN placement p ON p.placement_channel_id = c.id +INNER JOIN purchase_channel pc ON pc.channel_id = c.id +INNER JOIN placement p ON p.purchase_channel_id = pc.id INNER JOIN post po ON po.id = p.post_id WHERE po.deleted_from_channel_at IS NULL;`