Skip to content

[FEATURE] SQLModel Migration #852

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

Open
5 tasks
electron271 opened this issue May 12, 2025 · 0 comments · May be fixed by #853
Open
5 tasks

[FEATURE] SQLModel Migration #852

electron271 opened this issue May 12, 2025 · 0 comments · May be fixed by #853

Comments

@electron271
Copy link
Member

This will need to be done before 0.1.0

TODO

  • 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants