TELL-ME
Tables (6)
chat_messages
- message_id — UUID — Primary key — NOT NULL
- session_id — UUID — Foreign key → chat_sessions.session_id — NOT NULL
- role — message_role — NOT NULL
- content — TEXT — NOT NULL
- intent — message_intent
- sources — JSONB
- answerable — BOOLEAN
- created_at — TIMESTAMPTZ — NOT NULL
chat_sessions
- session_id — UUID — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.user_id — NOT NULL
- title — VARCHAR(200)
- created_at — TIMESTAMPTZ — NOT NULL
- last_active_at — TIMESTAMPTZ — NOT NULL
faq
- faq_id — BIGSERIAL — Primary key — NOT NULL
- category — VARCHAR(50) — NOT NULL
- question — TEXT — NOT NULL
- answer — TEXT — NOT NULL
- policy_ref — VARCHAR(100)
- version — INT — NOT NULL
- embedding — vector(1024)
- sync_status — faq_sync_status — NOT NULL
- is_deleted — BOOLEAN — NOT NULL
- created_by — BIGINT — Foreign key → users.user_id
- updated_by — BIGINT — Foreign key → users.user_id
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
message_feedback
- feedback_id — UUID — Primary key — NOT NULL
- message_id — UUID — Foreign key → chat_messages.message_id — NOT NULL
- user_id — BIGINT — Foreign key → users.user_id — NOT NULL
- rating — feedback_rating — NOT NULL
- comment — TEXT
- created_at — TIMESTAMPTZ — NOT NULL
store
- store_id — BIGSERIAL — Primary key — NOT NULL
- name — VARCHAR(100) — NOT NULL
- address — VARCHAR(255) — NOT NULL
- latitude — DECIMAL(9,6) — NOT NULL
- longitude — DECIMAL(9,6) — NOT NULL
- phone — VARCHAR(20)
- category — VARCHAR(50)
- is_deleted — BOOLEAN — NOT NULL
- created_by — BIGINT — Foreign key → users.user_id
- updated_by — BIGINT — Foreign key → users.user_id
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
users
- user_id — BIGSERIAL — Primary key — NOT NULL
- email — VARCHAR(255) — NOT NULL
- password_hash — VARCHAR(255) — NOT NULL
- name — VARCHAR(100) — NOT NULL
- role — user_role — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL