advanced-rag-framework
Tables (11)
tb_collection_llm_models
- id — INTEGER
- collection_id — INTEGER — Foreign key → tb_collections.collection_id — NOT NULL
- model_id — TEXT — Foreign key → tb_llm_models.model_id — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- UNIQUE(collection_id, — model_id)
tb_collections
- collection_id — INTEGER
- display_name — TEXT — NOT NULL
- qdrant_name — TEXT — NOT NULL
- description — TEXT — NOT NULL
- created_by — TEXT — Foreign key → tb_users.user_id
- is_active — INTEGER — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
- UNIQUE(created_by, — display_name)
tb_document_events
- event_id — INTEGER
- document_id — TEXT — NOT NULL
- collection_id — INTEGER — Foreign key → tb_collections.collection_id
- event_type — TEXT — NOT NULL
- event_message — TEXT
- actor_id — TEXT — Foreign key → tb_users.user_id
- event_at — TIMESTAMP — NOT NULL
- snapshot_json — TEXT
tb_documents
- document_id — TEXT
- collection_id — INTEGER — Foreign key → tb_collections.collection_id — NOT NULL
- uploaded_by — TEXT — Foreign key → tb_users.user_id
- original_filename — TEXT
- stored_filename — TEXT
- source_path — TEXT — NOT NULL
- file_size — INTEGER
- doc_type — TEXT
- title — TEXT
- file_format — TEXT
- parser_type — TEXT
- security_level — TEXT — NOT NULL
- version_no — INTEGER — NOT NULL
- total_pages — INTEGER
- chunk_count — INTEGER
- status — TEXT — NOT NULL
- error_message — TEXT
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
- deleted_at — TIMESTAMP
tb_llm_models
- model_id — TEXT
- model_name — TEXT — NOT NULL
- provider — TEXT — NOT NULL
- requires_api_key — INTEGER — NOT NULL
- is_enabled — INTEGER — NOT NULL
- sort_order — INTEGER — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
tb_query_logs
- log_id — INTEGER
- session_id — TEXT — Foreign key → tb_query_sessions.session_id
- user_id — TEXT — Foreign key → tb_users.user_id — NOT NULL
- collection_id — INTEGER — Foreign key → tb_collections.collection_id
- query_text — TEXT — NOT NULL
- answer_text — TEXT
- retrieved_chunks_json — TEXT
- response_time_ms — REAL
- chunks_retrieved — INTEGER
- answer_generated — INTEGER — NOT NULL
- error_message — TEXT
- feedback — INTEGER
- feedback_at — TIMESTAMP
- created_at — TIMESTAMP — NOT NULL
tb_query_sessions
- session_id — TEXT
- user_id — TEXT — Foreign key → tb_users.user_id — NOT NULL
- collection_id — INTEGER — Foreign key → tb_collections.collection_id
- conversation_history — TEXT — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
- expires_at — TIMESTAMP
tb_user_collection_permissions
- permission_id — INTEGER
- user_id — TEXT — Foreign key → tb_users.user_id — NOT NULL
- collection_id — INTEGER — Foreign key → tb_collections.collection_id — NOT NULL
- permission_level — TEXT — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- UNIQUE(user_id, — collection_id)
tb_user_llm_settings
- setting_id — INTEGER
- user_id — TEXT — Foreign key → tb_users.user_id — NOT NULL
- collection_id — INTEGER — Foreign key → tb_collections.collection_id — NOT NULL
- model_id — TEXT — Foreign key → tb_llm_models.model_id — NOT NULL
- api_key_enc — TEXT
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
- UNIQUE(user_id, — collection_id)
tb_user_security_policies
- user_id — TEXT — Foreign key → tb_users.user_id
- max_security_level — TEXT — NOT NULL
- allowed_doc_types — TEXT — NOT NULL
- metadata_filters — TEXT — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
tb_users
- user_id — TEXT
- user_pwd — TEXT — NOT NULL
- user_name — TEXT — NOT NULL
- role — TEXT — NOT NULL
- is_superadmin — INTEGER — NOT NULL
- is_active — INTEGER — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL