iiitl / iiitl/Cp_Discord_Bot

[feat]: Adopt ORM-Based Database Migrations and Models

Open
#4 0 comments 0 reactions 0 assignees View on GitHub
enhancement hard
Dominant language
JavaScript
Stars
0
Forks
3
PR merge metrics
No merged PRs in 30d

Description

### Problem
Current DB helper layer has no migration/versioning workflow and may allow duplicate records per user/platform.

### Proposed Work
- Choose and integrate an ORM (for example Prisma, Drizzle, or Sequelize) for SQLite.
- Define schema/models for current entities and enforce unique constraint on `(member_id, platform)`.
- Add migration scripts/commands for schema evolution.
- Refactor existing DB helpers to use ORM queries (including safe upserts).

### Acceptance Criteria
- Duplicate user-platform records are prevented at DB level.
- ORM migration command can be run repeatedly without breaking.
- Existing commands continue to work with the new ORM-backed data layer.

Contributor guide

Open the contributing guide

Research direction

Start by locating the current DB helper layer, entity definitions, and commands that use it. Compare Prisma, Drizzle, and Sequelize for SQLite, then verify the existing data shape and migration workflow. Done means unique (member_id, platform) records are enforced, migrations can be rerun safely, and existing commands still work through ORM-backed queries.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, sqlite
Domain
backend, database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.