38443-vm/db/migrations/20260217_rss_processed_items.sql
2026-02-17 00:29:34 +00:00

10 lines
440 B
SQL

-- Migration: Track processed RSS items to prevent re-posting after they are deleted by retention policy
CREATE TABLE IF NOT EXISTS rss_processed_items (
id INT AUTO_INCREMENT PRIMARY KEY,
channel_id INT NOT NULL,
rss_guid VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
UNIQUE KEY idx_channel_guid (channel_id, rss_guid),
FOREIGN KEY (channel_id) REFERENCES channels(id) ON DELETE CASCADE
);