CREATE TABLE article_versions (
    id               BIGSERIAL PRIMARY KEY,
    article_id       BIGINT NOT NULL REFERENCES articles(id),
    version_no       INT NOT NULL,
    title            VARCHAR(500),
    html_content     TEXT,
    markdown_content TEXT,
    word_count       INT NOT NULL DEFAULT 0,
    source_label     VARCHAR(100),
    created_at       TIMESTAMPTZ NOT NULL DEFAULT NOW(),
    CONSTRAINT uk_article_version_no UNIQUE (article_id, version_no)
);
