Tortoise Migration
TODO
- [x] 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.
Reviewer's Guide
This pull request initiates the migration from Prisma to Tortoise ORM by updating project dependencies and documentation references, laying the groundwork for further codebase refactoring.
File-Level Changes
| Change | Details | Files |
|---|---|---|
| Replaced Prisma ORM with Tortoise ORM in project dependencies and documentation. |
|
pyproject.tomlREADME.md |
| Updated poetry.lock to reflect dependency changes. |
|
poetry.lock |
Assessment against linked issues
| Issue | Objective | Addressed | Explanation |
|---|---|---|---|
| #843 | Uninstall Prisma-related packages. | ✅ | |
| #843 | Install Tortoise packages. | ✅ | |
| #843 | Adjust project requirements and documentation to reflect the change from Prisma to Tortoise. | ✅ |
Possibly linked issues
- #843: PR uninstalls Prisma and installs Tortoise, the initial step for the migration proposed in issue.
Tips and commands
Interacting with Sourcery
- Trigger a new review: Comment
@sourcery-ai reviewon the pull request. - Continue discussions: Reply directly to Sourcery's review comments.
- Generate a GitHub issue from a review comment: Ask Sourcery to create an
issue from a review comment by replying to it. You can also reply to a
review comment with
@sourcery-ai issueto create an issue from it. - Generate a pull request title: Write
@sourcery-aianywhere in the pull request title to generate a title at any time. You can also comment@sourcery-ai titleon the pull request to (re-)generate the title at any time. - Generate a pull request summary: Write
@sourcery-ai summaryanywhere in the pull request body to generate a PR summary at any time exactly where you want it. You can also comment@sourcery-ai summaryon the pull request to (re-)generate the summary at any time. - Generate reviewer's guide: Comment
@sourcery-ai guideon the pull request to (re-)generate the reviewer's guide at any time. - Resolve all Sourcery comments: Comment
@sourcery-ai resolveon the pull request to resolve all Sourcery comments. Useful if you've already addressed all the comments and don't want to see them anymore. - Dismiss all Sourcery reviews: Comment
@sourcery-ai dismisson the pull request to dismiss all existing Sourcery reviews. Especially useful if you want to start fresh with a new review - don't forget to comment@sourcery-ai reviewto trigger a new review!
Customizing Your Experience
Access your dashboard to:
- Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others.
- Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.
Getting Help
- Contact our support team for questions or feedback.
- Visit our documentation for detailed guides and information.
- Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.
Deploying tux with
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 |
@sourcery-ai dismiss
⏱️ 7m total CI duration on this PR
| Job | Cumulative Duration | Recent Runs |
|---|---|---|
| Analyze (python) | 2m | 🟩 🟩 |
| pyright | 2m | 🟥 🟥 🟥 |
| docker | 1m | 🟥 |
| Ruff | 1m | 🟩 🟩 🟩 |
| Analyze (actions) | 51s | 🟩 |
Given that tortoise does not fully meet our requirements for the project, can we fully close this pr, and then re-open down the line if needed?
@anemoijereja-eden yep, closed