[Backend] Database Models - SQLite Schema and SQLAlchemy Models #3

Closed
opened 2026-04-06 00:28:41 +02:00 by shoko · 0 comments
Owner

Overview

Create the database models and schemas for SQLite following the IMPLEMENTATION_PLAN.md.

Dependencies

  • Requires Backend Setup (issue #2) to be completed first

Tasks

  • Create User model with UUID, email, password_hash, timestamps
  • Create Bot model with user_id FK, name, description, strategy_config JSON, llm_config JSON, status
  • Create BotConversation model for chat history
  • Create Backtest model with config JSON, status, result JSON
  • Create Simulation model
  • Create Signal model for logging signals
  • Create all indexes as specified in IMPLEMENTATION_PLAN.md
  • Create Pydantic schemas for request/response validation
  • Test database creation and migrations

Database Tables

  1. users - User accounts
  2. bots - Trading bots (max 3 per user)
  3. bot_conversations - Chat history
  4. backtests - Backtest runs
  5. simulations - Simulation runs
  6. signals - Generated trading signals

Reference

See Section 4 for complete schema.

## Overview Create the database models and schemas for SQLite following the IMPLEMENTATION_PLAN.md. ## Dependencies - Requires **Backend Setup** (issue #2) to be completed first ## Tasks - [ ] Create User model with UUID, email, password_hash, timestamps - [ ] Create Bot model with user_id FK, name, description, strategy_config JSON, llm_config JSON, status - [ ] Create BotConversation model for chat history - [ ] Create Backtest model with config JSON, status, result JSON - [ ] Create Simulation model - [ ] Create Signal model for logging signals - [ ] Create all indexes as specified in IMPLEMENTATION_PLAN.md - [ ] Create Pydantic schemas for request/response validation - [ ] Test database creation and migrations ## Database Tables 1. users - User accounts 2. bots - Trading bots (max 3 per user) 3. bot_conversations - Chat history 4. backtests - Backtest runs 5. simulations - Simulation runs 6. signals - Generated trading signals ## Reference See Section 4 for complete schema.
shoko added this to the Phase 1 - Core MVP milestone 2026-04-06 00:28:41 +02:00
shoko added the backend label 2026-04-06 00:28:41 +02:00
shoko closed this issue 2026-04-08 06:57:47 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/randebu#3