Как выполнить миграцию Tortoise ORM?

Не могу выполнить миграцию (aerich migrate --name 123)
Получаю ошибку

Traceback
File "/home/name/.local/lib/python3.9/site-packages/aerich/cli.py", line 257, in main
    cli()
  File "/home/name/.local/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/name/.local/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/name/.local/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/name/.local/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/name/.local/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/name/.local/lib/python3.9/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/name/.local/lib/python3.9/site-packages/aerich/cli.py", line 31, in wrapper
    loop.run_until_complete(f(*args, **kwargs))
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/home/name/.local/lib/python3.9/site-packages/aerich/cli.py", line 86, in migrate
    ret = await command.migrate(name)
  File "/home/name/.local/lib/python3.9/site-packages/aerich/__init__.py", line 126, in migrate
    return await Migrate.migrate(name)
  File "/home/name/.local/lib/python3.9/site-packages/aerich/migrate.py", line 140, in migrate
    return await cls._generate_diff_sql(name)
  File "/home/name/.local/lib/python3.9/site-packages/aerich/migrate.py", line 112, in _generate_diff_sql
    version = await cls.generate_version(name)
  File "/home/name/.local/lib/python3.9/site-packages/aerich/migrate.py", line 102, in generate_version
    last_version_num = await cls._get_last_version_num()
  File "/home/name/.local/lib/python3.9/site-packages/aerich/migrate.py", line 93, in _get_last_version_num
    last_version = await cls.get_last_version()
  File "/home/name/.local/lib/python3.9/site-packages/aerich/migrate.py", line 55, in get_last_version
    return await Aerich.filter(app=cls.app).first()
  File "/usr/local/lib/python3.9/site-packages/tortoise/queryset.py", line 966, in _execute
    instance_list = await self._db.executor_class(
  File "/usr/local/lib/python3.9/site-packages/tortoise/backends/base/executor.py", line 129, in execute_select
    _, raw_results = await self.db.execute_query(query.get_sql())
  File "/usr/local/lib/python3.9/site-packages/tortoise/backends/mysql/client.py", line 44, in translate_exceptions_
    return await func(self, *args)
  File "/usr/local/lib/python3.9/site-packages/tortoise/backends/mysql/client.py", line 196, in execute_query
    async with self.acquire_connection() as connection:
  File "/usr/local/lib/python3.9/site-packages/tortoise/backends/base/client.py", line 303, in __aenter__
    self.connection = await self.pool.acquire()
AttributeError: 'NoneType' object has no attribute 'acquire'


Не могу понять в чем проблема, ведь на пк ошибки нет, но и изменений в бд тоже нет
  • Вопрос задан
  • 301 просмотр
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы