feat: add brand asset cleanup worker and related functionality
- Implemented a new BrandAssetCleanupWorker to handle the cleanup of brand-related assets after a brand is deleted. - Added SQL queries for cleaning up articles, keywords, questions, competitors, and monitoring data associated with a brand. - Introduced a new API endpoint to delete publish records. - Updated the router to include the new delete publish record endpoint. - Added tests for the BrandAssetCleanupWorker to ensure proper functionality. - Created migration scripts to support soft deletion of publish records and to add the brand asset cleanup scheduler job.
This commit is contained in:
@@ -122,6 +122,7 @@ const articlePublishStatusAggregateJoin = `
|
||||
FROM publish_records pr
|
||||
WHERE pr.tenant_id = a.tenant_id
|
||||
AND pr.article_id = a.id
|
||||
AND pr.deleted_at IS NULL
|
||||
ORDER BY
|
||||
COALESCE(pr.target_type, 'platform_account'),
|
||||
COALESCE(pr.platform_account_id, pr.target_connection_id),
|
||||
|
||||
Reference in New Issue
Block a user