Closed ArtemBernatskyy closed 1 day ago
What's the version? I tried but no error.
Just checked again, same error, latest tortoise version tortoise-orm==0.17.1
asyncpg==0.22.0
(postgresql latest from dockerhub)
File "/Users/artem/Desktop/LotteryBot/src/env/lib/python3.9/site-packages/tortoise/backends/asyncpg/client.py", line 36, in translate_exceptions_
return await func(self, *args)
File "/Users/artem/Desktop/LotteryBot/src/env/lib/python3.9/site-packages/tortoise/backends/asyncpg/client.py", line 176, in execute_query
rows = await connection.fetch(*params)
File "/Users/artem/Desktop/LotteryBot/src/env/lib/python3.9/site-packages/asyncpg/connection.py", line 583, in fetch
return await self._execute(
File "/Users/artem/Desktop/LotteryBot/src/env/lib/python3.9/site-packages/asyncpg/connection.py", line 1625, in _execute
result, _ = await self.__execute(
File "/Users/artem/Desktop/LotteryBot/src/env/lib/python3.9/site-packages/asyncpg/connection.py", line 1650, in __execute
return await self._do_execute(
File "/Users/artem/Desktop/LotteryBot/src/env/lib/python3.9/site-packages/asyncpg/connection.py", line 1677, in _do_execute
stmt = await self._get_statement(
File "/Users/artem/Desktop/LotteryBot/src/env/lib/python3.9/site-packages/asyncpg/connection.py", line 375, in _get_statement
statement = await self._protocol.prepare(
File "asyncpg/protocol/protocol.pyx", line 166, in prepare
asyncpg.exceptions.UndefinedColumnError: column "total_tickets" does not exist
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/artem/Desktop/LotteryBot/src/env/lib/python3.9/site-packages/discord/ext/tasks/__init__.py", line 101, in _loop
await self.coro(*args, **kwargs)
File "/Users/artem/Desktop/LotteryBot/src/app/extensions/lottery.py", line 207, in lottery_status_cron_job
await self._handle_payments_to_winners()
File "/Users/artem/Desktop/LotteryBot/src/app/extensions/lottery.py", line 170, in _handle_payments_to_winners
await Lottery.filter(Q(status=LotteryStatus.ENDED) & Q(has_winners=False))
File "/Users/artem/Desktop/LotteryBot/src/env/lib/python3.9/site-packages/tortoise/queryset.py", line 836, in _execute
instance_list = await self._db.executor_class(
File "/Users/artem/Desktop/LotteryBot/src/env/lib/python3.9/site-packages/tortoise/backends/base/executor.py", line 124, in execute_select
_, raw_results = await self.db.execute_query(query.get_sql())
File "/Users/artem/Desktop/LotteryBot/src/env/lib/python3.9/site-packages/tortoise/backends/asyncpg/client.py", line 38, in translate_exceptions_
raise OperationalError(exc)
tortoise.exceptions.OperationalError: column "total_tickets" does not exist
I receive
tortoise.exceptions.OperationalError: column "total_tickets" does not exist
(in Django we could use multiple annotations)PS I know it could be
RTFM
but I've tried searching issues / reading docs but without success, thx in advance for any help! PPS here is models that I use