Comment '@unateam @Michael...' to 'UNA 14 Timeline Cleanup Script – Expert Review Requested'
  • @unateam @Michael Newton

    Regarding validation - here's what I need:

    Before running the cleanup script, I want to run two SQL queries to verify the counts:

    Example scenario:

    • Total posts: 1000
    • Posts older than 30 days: 700
    • Posts within 30 days: 300

    Query 1 (old posts to delete):

    sql

    SELECT COUNT(*) FROM bx_timeline_events 
    WHERE type IN ('timeline_common_post', 'timeline_common_repost') 
    AND date < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 30 DAY));
    

    Expected result: 700

    Query 2 (recent posts to keep):

    sql

    SELECT COUNT(*) FROM bx_timeline_events 
    WHERE type IN ('timeline_common_post', 'timeline_common_repost') 
    AND date >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 30 DAY));
    

    Expected result: 300

    After cleanup completes: Total remaining should be exactly 300.

    Question: Are these queries accurate for distinguishing old vs. recent timeline posts in UNA?