botserver/src
Rodrigo Rodriguez (Pragmatismo) 7634429896 Consolidate all database migrations into single optimized schema
BREAKING CHANGE: Complete database redesign

Migrations:
- Remove all 6.x.x and 7.0.0 migrations
- Create single consolidated migration 20250101000000_consolidated_schema
- Add Diesel initial setup migration

Schema Optimizations:
- All domain values use SMALLINT instead of VARCHAR/TEXT (2 bytes vs 20+ bytes)
- Sharding infrastructure: shard_config, tenant_shard_map tables
- All tables include tenant_id and shard_id for horizontal scaling
- Proper indexing strategies for high-throughput queries
- Foreign key constraints for data integrity
- Updated_at triggers via diesel_manage_updated_at

Tables (35 total):
- Core: tenants, users, bots, bot_configuration, bot_channels
- Sessions: user_sessions, message_history
- Memory: bot_memories
- Auto Tasks: auto_tasks, execution_plans, task_approvals, task_decisions
- Safety: safety_audit_log, intent_classifications
- Apps: generated_apps, designer_changes, designer_pending_changes
- KB: kb_collections, kb_documents, session_kb_associations, kb_sources
- Tools: tools, system_automations, pending_info
- Analytics: usage_analytics, analytics_events
- Tasks: tasks, task_comments
- Accounts: connected_accounts, session_account_associations
- Communication: whatsapp_numbers, clicks
- Access: table_role_access, context_injections
- Organizations: organizations, user_organizations

Rust Schema:
- Updated schema.rs to match new consolidated schema
- All diesel table definitions with proper types
- Foreign key relationships defined

WARNING: This is a DESTRUCTIVE migration - drop existing database before applying
2025-12-29 12:29:23 -03:00
..
analytics App generator LLM-only, app logs, knowledge base, web search, designer magic 2025-12-28 11:50:50 -03:00
attendance feat(security): Complete security infrastructure implementation 2025-12-28 19:29:18 -03:00
auto_task Add billion-scale database redesign with enums and sharding 2025-12-29 11:27:13 -03:00
basic Security audit: Remove all production .unwrap()/.expect(), add SafeCommand, ErrorSanitizer 2025-12-28 21:26:08 -03:00
calendar Security audit: Remove all production .unwrap()/.expect(), add SafeCommand, ErrorSanitizer 2025-12-28 21:26:08 -03:00
compliance feat(security): Complete security infrastructure implementation 2025-12-28 19:29:18 -03:00
console feat(security): Complete security infrastructure implementation 2025-12-28 19:29:18 -03:00
core Consolidate all database migrations into single optimized schema 2025-12-29 12:29:23 -03:00
designer feat(security): Complete security infrastructure implementation 2025-12-28 19:29:18 -03:00
directory feat(autotask): Implement AutoTask system with intent classification and app generation 2025-12-27 21:10:09 -03:00
drive Fix organizations foreign key reference (org_id not id) 2025-12-29 08:07:42 -03:00
email Fix organizations foreign key reference (org_id not id) 2025-12-29 08:07:42 -03:00
instagram feat(autotask): Implement AutoTask system with intent classification and app generation 2025-12-27 21:10:09 -03:00
llm Add billion-scale database redesign with enums and sharding 2025-12-29 11:27:13 -03:00
meet App generator LLM-only, app logs, knowledge base, web search, designer magic 2025-12-28 11:50:50 -03:00
monitoring Remove all code comments and fix ratatui version 2025-12-23 18:40:58 -03:00
msteams feat(autotask): Implement AutoTask system with intent classification and app generation 2025-12-27 21:10:09 -03:00
multimodal Security audit: Remove all production .unwrap()/.expect(), add SafeCommand, ErrorSanitizer 2025-12-28 21:26:08 -03:00
nvidia App generator LLM-only, app logs, knowledge base, web search, designer magic 2025-12-28 11:50:50 -03:00
paper Fix clippy warnings: match arms, async/await, Debug impls, formatting 2025-12-26 08:59:25 -03:00
research App generator LLM-only, app logs, knowledge base, web search, designer magic 2025-12-28 11:50:50 -03:00
security Security audit: Remove all production .unwrap()/.expect(), add SafeCommand, ErrorSanitizer 2025-12-28 21:26:08 -03:00
sources App generator LLM-only, app logs, knowledge base, web search, designer magic 2025-12-28 11:50:50 -03:00
tasks feat(security): Complete security infrastructure implementation 2025-12-28 19:29:18 -03:00
timeseries Remove all code comments and fix ratatui version 2025-12-23 18:40:58 -03:00
vector-db feat(security): Complete security infrastructure implementation 2025-12-28 19:29:18 -03:00
weba feat(autotask): Implement AutoTask system with intent classification and app generation 2025-12-27 21:10:09 -03:00
whatsapp feat(autotask): Implement AutoTask system with intent classification and app generation 2025-12-27 21:10:09 -03:00
lib.rs Fix organizations foreign key reference (org_id not id) 2025-12-29 08:07:42 -03:00
main.rs Add billion-scale database redesign with enums and sharding 2025-12-29 11:27:13 -03:00