tux icon indicating copy to clipboard operation
tux copied to clipboard

[FEATURE] SQLModel Migration

Open electron271 opened this issue 7 months ago • 0 comments

This will need to be done before 0.1.0

TODO

  • [x] Uninstall Prisma-related packages.
  • [ ] Refactor models and DB scripts to SQLModel conventions.
  • [ ] Replace all Prisma CRUD/query calls with SQLModel equivalents.
  • [ ] Set up Alembic for database migrations.
  • [ ] Adjust project requirements and documentation.

Packages

We would be using https://sqlmodel.tiangolo.com/ and https://github.com/sqlalchemy/alembic for migrations.

Drawbacks

  • Async support uncertain

Advantages

  • Fully python
  • More mature project

Areas migration will affect:

  • database schemas in tux/prisma will need to be re-written for SQLModel, and migrations performed on the database
  • database controllers and associated logic in tux/tux/database
  • Remindme cog directly pulls the Reminder DB model
  • poll cog pulls in the CaseType enum
  • AFK systems directly imports the AFK model
  • snippets use the CaseType enum
  • all moderation cogs pull in CaseType enum
  • moderation cases cog
  • influxdb cog
  • utils/converters.py pulls in from prisma.enums
  • utils/exceptions pulls in prisma.models.Case
  • utils/flags pulls in the CaseType enum
  • probably several more that we'll find during the process

Alternative to #843

electron271 avatar May 12 '25 01:05 electron271