Compare commits

..

2 commits

Author SHA1 Message Date
2d15133555 Merge branch 'main' of https://alm.pragmatismo.com.br/generalbots/gbserver
All checks were successful
GBCI / build (push) Successful in 7m22s
2025-10-03 08:04:56 -03:00
dec65c39ff Add user_sessions table to database schema 2025-10-03 07:41:37 -03:00
2 changed files with 13 additions and 0 deletions

View file

@ -0,0 +1,13 @@
CREATE TABLE IF NOT EXISTS user_sessions (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id TEXT NOT NULL,
bot_id TEXT NOT NULL,
answer_mode TEXT NOT NULL DEFAULT 'direct',
context JSONB NOT NULL DEFAULT '{}',
current_tool TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
UNIQUE(user_id, bot_id)
);
CREATE INDEX IF NOT EXISTS idx_user_sessions_user_bot ON user_sessions(user_id, bot_id);

0
test.rs Normal file
View file