File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -125,48 +125,58 @@ mise run clean # Clean build artifacts
125125
126126## Database
127127
128- SQLite database (` ./data/idle.db ` ) contains:
129-
130- ** users**
131-
132- - discord_id (PK)
133- - user_id (Idle Champions user ID)
134- - user_hash (Idle Champions auth token)
135- - server (game server URL)
136- - instance_id (deprecated - fetched fresh each time)
137- - created_at, updated_at
138-
139- ** redeemed_codes**
140-
141- - id (PK)
142- - code
143- - discord_id
144- - status
145- - loot (JSON)
146- - timestamp
147-
148- ** pending_codes**
149-
150- - id (PK)
151- - code
152- - discord_id
153- - added_at
154-
155- ** audit_log**
156-
157- - id (PK)
158- - discord_id
159- - action
160- - details (JSON)
161- - timestamp
162-
163- ** backfill_operations**
164-
165- - id (PK)
166- - initiated_by (user who initiated or "system" for automatic)
167- - started_at, completed_at
168- - codes_found, codes_redeemed (counts)
169- - status (in_progress, completed, failed)
128+ SQLite database (` ./data/idle.db ` ) with the following structure:
129+
130+ ``` mermaid
131+ erDiagram
132+ USERS ||--o{ REDEEMED_CODES : "has"
133+ USERS ||--o{ PENDING_CODES : "has"
134+ USERS ||--o{ AUDIT_LOG : "generates"
135+
136+ USERS {
137+ string discord_id PK
138+ int user_id "Idle Champions user ID"
139+ string user_hash "Idle Champions auth token"
140+ string server "game server URL"
141+ string instance_id "deprecated"
142+ datetime created_at
143+ datetime updated_at
144+ }
145+
146+ REDEEMED_CODES {
147+ int id PK
148+ string code
149+ string discord_id FK
150+ string status
151+ json loot
152+ datetime timestamp
153+ }
154+
155+ PENDING_CODES {
156+ int id PK
157+ string code
158+ string discord_id FK
159+ datetime added_at
160+ }
161+
162+ AUDIT_LOG {
163+ int id PK
164+ string discord_id FK
165+ string action
166+ json details
167+ datetime timestamp
168+ }
169+
170+ BACKFILL_OPERATIONS {
171+ int id PK
172+ string initiated_by "user ID or 'system'"
173+ datetime started_at
174+ datetime completed_at
175+ int codes_found
176+ int codes_redeemed
177+ string status "in_progress, completed, failed"
178+ }
179+ ```
170180
171181## Testing Commands
172182
You can’t perform that action at this time.
0 commit comments