Thanks to visit codestin.com
Credit goes to github.com

Skip to content

refactor: migrate worker database layer to prisma orm #2

@mdkaifansari04

Description

@mdkaifansari04

Issue

The worker db layer is still messy.
raw queries everywhere, logic scattered across handlers, no clear source of truth.
this works for now, but it’s risky and won’t scale.

we agreed to add prisma but it needs to be done properly, not half-done.

Goals

  • introduce prisma as the main orm for the worker
  • define a clear prisma schema for existing models
  • centralize db access via prisma client
  • remove raw db queries from handlers
  • keep current behavior working

Scope

  • setup prisma (schema, client, config)
  • map existing tables into prisma schema
  • refactor handlers to use prisma
  • update MIGRATE_TO_PRISMA.md if needed
  • make sure tests pass (or update them)

Acceptance

  • prisma is the single way to access the db
  • no raw queries left in handlers
  • prisma client is cleanly initialized and reused
  • worker runs without regression
  • migration path is documented

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions