CREATE TABLE IF NOT EXISTS categories (
    id           UUID        PRIMARY KEY DEFAULT gen_random_uuid(),
    name         TEXT        NOT NULL UNIQUE,
    description  TEXT        NOT NULL DEFAULT '',
    thread_count INT         NOT NULL DEFAULT 0,
    post_count   INT         NOT NULL DEFAULT 0,
    created_at   TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

INSERT INTO categories (name, description) VALUES
    ('General Discussion', 'Talk about anything and everything.'),
    ('Tech Talk',          'Computers, software, hardware — geek out here.'),
    ('Introductions',      'New to the forum? Say hello!'),
    ('Off Topic',          'Everything else that doesn''t fit anywhere.')
ON CONFLICT (name) DO NOTHING;
