CREATE TABLE post_viewers
(
    post_id INTEGER NOT NULL,
    ip INET NOT NULL,
    last_viewed_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),

    PRIMARY KEY(post_id, ip)
);

COMMENT ON COLUMN post_viewers.post_id IS '文章id';
COMMENT ON COLUMN post_viewers.ip IS '访问ip';
COMMENT ON COLUMN post_viewers.last_viewed_at IS '最后访问时间';