CREATE TABLE users (
    id INTEGER PRIMARY KEY, -- is alias of SQLite's rowid
    name,
    login
);

CREATE TABLE posts (
    user INTEGER, -- users.id
    txt TEXT, 
    parent INTEGER, -- Not used. Haven't needed replies yet.
    posted INTEGER, -- unix epoch
    updated INTEGER, -- unix epoch
    touched INTEGER, -- Counter, updates on edit/react
    filename TEXT
);

-- For 2.6 -> 3.0, add 'touched' column (run this)
-- ALTER TABLE ADD COLUMN touched int;
-- UPDATE posts SET touched = rowid;

-- Added in v3.0
CREATE TABLE reactions (
    post INTEGER, -- posts.rowid
    user INTEGER, -- users.id
    emoji TEXT,
    txt TEXT
);

