Skip to content

SQLModel Migration #853

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 17 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# Database URLs (Required: one depending on mode)
# The application uses DEV_DATABASE_URL when run with '--dev' flag,
# and PROD_DATABASE_URL otherwise (production mode).
# PREFIX SHOULD BE postgresql+asyncpg://"
DEV_DATABASE_URL=""
PROD_DATABASE_URL=""

Expand Down
555 changes: 420 additions & 135 deletions poetry.lock

Large diffs are not rendered by default.

14 changes: 0 additions & 14 deletions prisma/schema/commands/afk.prisma

This file was deleted.

60 changes: 0 additions & 60 deletions prisma/schema/commands/moderation.prisma

This file was deleted.

14 changes: 0 additions & 14 deletions prisma/schema/commands/reminder.prisma

This file was deleted.

15 changes: 0 additions & 15 deletions prisma/schema/commands/snippets.prisma

This file was deleted.

28 changes: 0 additions & 28 deletions prisma/schema/guild/config.prisma

This file was deleted.

16 changes: 0 additions & 16 deletions prisma/schema/guild/guild.prisma

This file was deleted.

13 changes: 0 additions & 13 deletions prisma/schema/guild/levels.prisma

This file was deleted.

25 changes: 0 additions & 25 deletions prisma/schema/guild/starboard.prisma

This file was deleted.

12 changes: 0 additions & 12 deletions prisma/schema/main.prisma

This file was deleted.

6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ githubkit = { version = ">=0.12.0", extras = ["auth-app"] }
httpx = ">=0.28.0"
jishaku = ">=2.5.2"
loguru = ">=0.7.2"
pillow = ">=11.2.1,<11.3.0"
prisma = ">=0.15.0"
pillow = ">=11.3.0,<11.4.0"
psutil = ">=6.0.0"
pynacl = ">=1.5.0"
python-dotenv = ">=1.0.1"
Expand All @@ -52,6 +51,9 @@ arrow = "^1.3.0"
click = "^8.1.8"
levenshtein = "^0.27.1"
jinja2 = "^3.1.6"
sqlmodel = "^0.0.24"
asyncpg = "^0.30.0"
alembic = "^1.16.2"

[tool.poetry.group.dev.dependencies]
pre-commit = "==4.2.0"
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/tux/utils/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import pytest

from prisma.models import Case
from tux.database.schemas import Case
from tux.utils.exceptions import (
APIConnectionError,
APIRequestError,
Expand Down
2 changes: 1 addition & 1 deletion tux/cogs/moderation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import discord
from discord.ext import commands
from loguru import logger

from prisma.enums import CaseType

from tux.bot import Tux
from tux.database.controllers import DatabaseController
from tux.ui.embeds import EmbedCreator, EmbedType
Expand Down
2 changes: 1 addition & 1 deletion tux/cogs/moderation/ban.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import discord
from discord.ext import commands

from prisma.enums import CaseType

from tux.bot import Tux
from tux.utils import checks
from tux.utils.flags import BanFlags
Expand Down
2 changes: 1 addition & 1 deletion tux/cogs/moderation/cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from reactionmenu import ViewButton, ViewMenu

from prisma.enums import CaseType
from prisma.models import Case
from prisma.types import CaseWhereInput
from tux.bot import Tux
from tux.database.schemas import Case
from tux.ui.embeds import EmbedCreator, EmbedType
from tux.utils import checks
from tux.utils.constants import CONST
Expand Down
2 changes: 1 addition & 1 deletion tux/cogs/moderation/jail.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import discord
from discord.ext import commands
from loguru import logger

from prisma.enums import CaseType

from tux.bot import Tux
from tux.utils import checks
from tux.utils.flags import JailFlags
Expand Down
2 changes: 1 addition & 1 deletion tux/cogs/moderation/kick.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import discord
from discord.ext import commands

from prisma.enums import CaseType

from tux.bot import Tux
from tux.utils import checks
from tux.utils.flags import KickFlags
Expand Down
2 changes: 1 addition & 1 deletion tux/cogs/moderation/pollban.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import discord
from discord.ext import commands

from prisma.enums import CaseType

from tux.bot import Tux
from tux.utils import checks
from tux.utils.flags import PollBanFlags
Expand Down
2 changes: 1 addition & 1 deletion tux/cogs/moderation/pollunban.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import discord
from discord.ext import commands

from prisma.enums import CaseType

from tux.bot import Tux
from tux.utils import checks
from tux.utils.flags import PollUnbanFlags
Expand Down
2 changes: 1 addition & 1 deletion tux/cogs/moderation/snippetban.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import discord
from discord.ext import commands

from prisma.enums import CaseType

from tux.bot import Tux
from tux.utils import checks
from tux.utils.flags import SnippetBanFlags
Expand Down
2 changes: 1 addition & 1 deletion tux/cogs/moderation/snippetunban.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import discord
from discord.ext import commands

from prisma.enums import CaseType

from tux.bot import Tux
from tux.utils import checks
from tux.utils.flags import SnippetUnbanFlags
Expand Down
2 changes: 1 addition & 1 deletion tux/cogs/moderation/tempban.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from loguru import logger

from prisma.enums import CaseType
from prisma.models import Case
from tux.bot import Tux
from tux.database.schemas import Case
from tux.utils import checks
from tux.utils.flags import TempBanFlags
from tux.utils.functions import generate_usage
Expand Down
2 changes: 1 addition & 1 deletion tux/cogs/moderation/timeout.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import discord
from discord.ext import commands

from prisma.enums import CaseType

from tux.bot import Tux
from tux.utils import checks
from tux.utils.flags import TimeoutFlags
Expand Down
2 changes: 1 addition & 1 deletion tux/cogs/moderation/unban.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import discord
from discord.ext import commands

from prisma.enums import CaseType

from tux.bot import Tux
from tux.utils import checks
from tux.utils.constants import CONST
Expand Down
2 changes: 1 addition & 1 deletion tux/cogs/moderation/unjail.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from loguru import logger

from prisma.enums import CaseType
from prisma.models import Case
from tux.bot import Tux
from tux.database.schemas import Case
from tux.utils import checks
from tux.utils.flags import UnjailFlags
from tux.utils.functions import generate_usage
Expand Down
2 changes: 1 addition & 1 deletion tux/cogs/moderation/untimeout.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import discord
from discord.ext import commands

from prisma.enums import CaseType

from tux.bot import Tux
from tux.utils import checks
from tux.utils.flags import UntimeoutFlags
Expand Down
2 changes: 1 addition & 1 deletion tux/cogs/moderation/warn.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import discord
from discord.ext import commands

from prisma.enums import CaseType

from tux.bot import Tux
from tux.utils import checks
from tux.utils.flags import WarnFlags
Expand Down
3 changes: 1 addition & 2 deletions tux/cogs/snippets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
from discord.ext import commands
from loguru import logger

from prisma.enums import CaseType
from prisma.models import Snippet
from tux.bot import Tux
from tux.database.controllers import DatabaseController
from tux.database.schemas import CaseType, Snippet
from tux.ui.embeds import EmbedCreator, EmbedType
from tux.utils import checks
from tux.utils.config import Config
Expand Down
Loading