v_xml_cdr_json changed from start_stamp to insert_date (#438)

v_xml_cdr_json.start_stamp is always null so the old records in this table were not being purged. Changed to v_xml_cdr_json.insert_date since this field is populated
This commit is contained in:
chansizzle
2025-02-04 08:46:35 -07:00
committed by GitHub
parent 2ede664657
commit dee7ae0943

View File

@@ -117,7 +117,7 @@ if [ .$purge_cdrs = .true ]; then
#call detail record - call flow
psql $db_name --port $db_port --host=$db_host --username=$db_username -c "delete from v_xml_cdr_flow WHERE insert_date < NOW() - INTERVAL '$days_keep_cdrs days'"
#call detail record - json
psql $db_name --port $db_port --host=$db_host --username=$db_username -c "delete from v_xml_cdr_json WHERE start_stamp < NOW() - INTERVAL '$days_keep_cdrs days'"
psql $db_name --port $db_port --host=$db_host --username=$db_username -c "delete from v_xml_cdr_json WHERE insert_date < NOW() - INTERVAL '$days_keep_cdrs days'"
#call detail record - call logs
psql $db_name --port $db_port --host=$db_host --username=$db_username -c "delete from v_xml_cdr_logs WHERE insert_date < NOW() - INTERVAL '$days_keep_cdrs days'"
else