Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert db migration logic from alembic to typescript orm #165

Open
6 tasks
fearnworks opened this issue Feb 17, 2025 · 1 comment · May be fixed by #171
Open
6 tasks

Convert db migration logic from alembic to typescript orm #165

fearnworks opened this issue Feb 17, 2025 · 1 comment · May be fixed by #171
Labels
frontend javascript Pull requests that update Javascript code python Pull requests that update Python code

Comments

@fearnworks
Copy link
Collaborator

fearnworks commented Feb 17, 2025

Summary

Transition the current database migration system from Alembic (SQLAlchemy) to a TypeScript-based ORM (Prisma or Drizzle) to align with a potential unification of the backend under the Svelte frontend framework.

Background

Currently, the project uses Alembic for managing schema migrations within the Python-based backend. However, if the backend moves towards a full SvelteKit-based architecture, using a TypeScript ORMfor database interactions would simplify development and reduce cross-language dependencies.

Objectives

  • Assess Prisma and Drizzle and others as potential replacements.
  • Plan a structured migration from Alembic to the selected ORM.
  • Integrate migration checks into the frontend container (instead of as an external manual process)
  • Add seed scripts and tests for migration
  • Update relevant documentation and setup guides. Fill in missing policies in documentation, especially around db schema branching.
  • Include fix for Remove unused columns from user table #70
@fearnworks fearnworks added frontend javascript Pull requests that update Javascript code python Pull requests that update Python code labels Feb 17, 2025
@fearnworks
Copy link
Collaborator Author

fearnworks commented Feb 19, 2025

Capturing analysis notes here :

Migration Assessment

  • Prisma is a no-go. No sql joins and dsl lock in.
  • Drizzle can do an export from current db into a migration script. Can utilize raw sql easily.
  • Atlas is completely agnostic, could be used across languages, but additional dsl makes me wary.
  • Also assessing "no orm" option

Considerations :

  • Ease to pick up and maintain
  • Migration / Branching suppport
  • JSONB performance if being used as ORM

Migration Plan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend javascript Pull requests that update Javascript code python Pull requests that update Python code
Projects
None yet
1 participant