CREATE TABLE chat (
   id INTEGER PRIMARY KEY NOT NULL,
   telegram_id BIGINT UNIQUE NOT NULL,
   calendar TEXT NOT NULL,
   next_appointment_start BIGINT,
   next_appointment_end BIGINT,
   last_reminder BIGINT,
   pinned_message_id INTEGER
);

CREATE INDEX chat_telegram_id ON chat (
   telegram_id
);
