Skip to content

Tortoise Migration #850

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Tortoise Migration #850

wants to merge 2 commits into from

Conversation

electron271
Copy link
Member

@electron271 electron271 commented May 11, 2025

TODO

  • Uninstall Prisma-related packages and install Tortoise packages.
  • Refactor models and DB scripts to Tortoise conventions.
  • Replace all Prisma CRUD/query calls with Tortoise equivalents.
  • Set up Aerich for database migrations.
  • Adjust project requirements and documentation.

Areas migration will affect:

  • database schemas in tux/prisma will need to be re-written for tortoise, 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

closes #843

Summary by Sourcery

Switch the project's ORM from Prisma to Tortoise, updating dependencies and documentation accordingly.

New Features:

  • Add Tortoise ORM as the project's database ORM.

Enhancements:

  • Remove Prisma ORM and its dependencies from the project.

Documentation:

  • Update documentation to reference Tortoise ORM instead of Prisma.

This comment was marked as resolved.

@electron271 electron271 marked this pull request as draft May 11, 2025 20:51
Copy link

cloudflare-workers-and-pages bot commented May 11, 2025

Deploying tux with  Cloudflare Pages  Cloudflare Pages

Latest commit: b535717
Status: ✅  Deploy successful!
Preview URL: https://d2db30fb.tux-afh.pages.dev
Branch Preview URL: https://tortoise.tux-afh.pages.dev

View logs

@electron271 electron271 changed the title feat(pyproject.toml): uninstall prisma and install tortoise Tortoise Migration May 11, 2025
sourcery-ai[bot]

This comment was marked as resolved.

@electron271
Copy link
Member Author

@sourcery-ai dismiss

Copy link

trunk-io bot commented May 12, 2025

⏱️ 7m total CI duration on this PR

Job Cumulative Duration Recent Runs
Analyze (python) 2m 🟩🟩
pyright 2m 🟥🟥🟥
docker 1m 🟥
Ruff 1m 🟩🟩🟩
Analyze (actions) 51s 🟩

settingsfeedbackdocs ⋅ learn more about trunk.io

@electron271 electron271 mentioned this pull request May 12, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Tortoise Migration
2 participants