[feat]: Adopt ORM-Based Database Migrations and Models
- 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
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