CREATE TABLE IF NOT EXISTS users (
    id                SERIAL PRIMARY KEY,
    "telegramId"      BIGINT UNIQUE NOT NULL,
    username          TEXT,
    fio               TEXT,
    "createdAt"       TIMESTAMP NOT NULL DEFAULT NOW(),
    frequency         INTEGER NOT NULL DEFAULT 1,
    "lastQuoteSentAt" TIMESTAMP NOT NULL DEFAULT NOW()
);

CREATE UNIQUE INDEX IF NOT EXISTS users_telegram_id_key ON users ("telegramId");
