Commit b798570
feat: add database for moderation (#4)
* chore: add plan for database
* feat: introduce prisma
* docs: implement SQLite database with Prisma for moderation actions tracking
* feat: add moderation tables and update schema for user actions tracking
* feat: implement database connection and graceful shutdown in bot
* feat: add analytics and operations modules for user and moderation action management
* test: add comprehensive database tests
* refactor: improve variable naming for clarity in analytics and database tests
* test: enhance database action counting tests to verify accurate totals after action creation and error removal
* refactor: update Prisma schema to introduce new roles and action types, and streamline action status definitions
* feat: add User and Action models to Prisma schema, replacing ModerationAction and updating relationships
* chore: remove unused analytics and operations modules along with associated tests
* fix: correct spelling of 'DISRESPECTFUL' in ActionReason enum in Prisma schema
* chore: remove outdated database implementation plan and related files
* chore: update docker-compose and Dockerfile to use named volumes and add migration service
* chore: update datasource URL in Prisma configuration to point to moderation database
* chore: remove unused script.ts file and related database connection logic
* Update prisma/schema.prisma
Co-authored-by: Copilot <[email protected]>
* chore: add new Prisma scripts for database migration, validation, and formatting; update dependencies
* chore: upgrade Prisma dependencies to version 7.0.0 and update related lockfile entries
* chore: update Prisma schema to add VOICE_MODERATOR role, rename DISRESPECTFUL to DISRUPTIVE, and clean up model relationships
---------
Co-authored-by: Copilot <[email protected]>1 parent 65374af commit b798570
File tree
13 files changed
+1284
-4
lines changed- prisma
- migrations
- 20251031193446_init
- 20251101170231_add_moderation_tables
- 20251109140048_add_user_and_action_models
- 20251109140934_remove_duration_field
- src
13 files changed
+1284
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
| 170 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
| |||
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
| 45 | + | |
| 46 | + | |
42 | 47 | | |
| 48 | + | |
43 | 49 | | |
44 | 50 | | |
45 | 51 | | |
| |||
56 | 62 | | |
57 | 63 | | |
58 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
59 | 68 | | |
60 | 69 | | |
61 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| 27 | + | |
| 28 | + | |
24 | 29 | | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
28 | 33 | | |
29 | 34 | | |
30 | 35 | | |
| 36 | + | |
31 | 37 | | |
32 | 38 | | |
33 | 39 | | |
| |||
0 commit comments