-- Cron log table for publish events
CREATE TABLE IF NOT EXISTS cron_logs (
    id INT AUTO_INCREMENT PRIMARY KEY,
    datetime DATETIME NOT NULL,
    level VARCHAR(16) NOT NULL,
    message TEXT NOT NULL,
    channel VARCHAR(32) NOT NULL DEFAULT 'publish',
    INDEX idx_channel_datetime (channel, datetime)
);

-- Usuwanie starszych niż 30 dni (możesz dodać do crona lub uruchamiać ręcznie):
-- DELETE FROM cron_logs WHERE datetime < (NOW() - INTERVAL 30 DAY);
