Merged
Conversation
…s after action creation and error removal
…s, and streamline action status definitions
…onAction and updating relationships
…add migration service
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a database layer for moderation functionality using Prisma with SQLite. The implementation introduces a schema for tracking users, moderation actions, and their relationships, along with Docker configuration updates to support database migrations and persistence.
Key Changes:
- Adds Prisma schema with User and Action models to track moderation events
- Implements graceful shutdown handlers in the application entry point
- Configures Docker volumes and migration service for database persistence
Reviewed Changes
Copilot reviewed 11 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/index.ts | Adds SIGINT/SIGTERM handlers for graceful shutdown |
| prisma/schema.prisma | Defines database schema with User and Action models, enums for roles, action types, and statuses |
| prisma.config.ts | Configures Prisma with schema path, migrations, and datasource |
| package.json | Adds Prisma dependencies (@prisma/client, @prisma/adapter-better-sqlite3, prisma) |
| docker-compose.yml | Updates volumes to named volumes and adds migrate service for running database migrations |
| Dockerfile | Adds Prisma client generation steps and copies generated files to production image |
| prisma/migrations/*.sql | Migration files for database schema evolution |
| prisma/migrations/migration_lock.toml | Locks SQLite as the migration provider |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
hmd-ali
approved these changes
Nov 9, 2025
… formatting; update dependencies
…d lockfile entries
…SPECTFUL to DISRUPTIVE, and clean up model relationships
hmd-ali
approved these changes
Nov 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
erDiagram User { int userId PK string discordUserId UK Role role } Action { int actionId PK int userId FK ActionType type ActionStatus status int moderatorUserId FK ActionReason reason string note int createdAt int expiresAt int revertingActionId FK } User ||--o{ Action : "receives actions" User ||--o{ Action : "moderates" Action ||--o| Action : "reverts"