CREATE TABLE news_backup
(
    id         INTEGER PRIMARY KEY AUTOINCREMENT,
    title      TEXT      NOT NULL,
    summary    TEXT,
    url        TEXT      NOT NULL,
    published  TIMESTAMP NOT NULL,
    country    TEXT      NOT NULL,
    created_at INTEGER DEFAULT (strftime('%s', 'now'))
);

INSERT INTO news_backup
SELECT id, title, summary, url, published, country, created_at
FROM news;
DROP TABLE news;
ALTER TABLE news_backup
    RENAME TO news;
CREATE INDEX IF NOT EXISTS idx_news_published ON news (published);
