CREATE TABLE IF NOT EXISTS posts (
    id TEXT NOT NULL PRIMARY KEY,
    created BIGINT NOT NULL,
    content TEXT NOT NULL,
    owner TEXT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
    context TEXT NOT NULL,
    replying_to TEXT REFERENCES posts(id) ON DELETE CASCADE, -- the ID of the post this is a comment on... 0 means it isn't a reply
    -- likes
    likes INT NOT NULL,
    dislikes INT NOT NULL,
    -- other counts
    comment_count INT NOT NULL,
    -- ...
    uploads TEXT NOT NULL,
    is_deleted INT NOT NULL,
    tsvector_content tsvector GENERATED ALWAYS AS (to_tsvector ('english', coalesce(content, ''))) STORED,
    poll_id TEXT REFERENCES polls(id) ON DELETE CASCADE,
    views INT NOT NULL,
    group_id TEXT REFERENCES groups(id) ON DELETE CASCADE,
    limited_reach INT NOT NULL
)
