0

I have run the alembic upgrade head using docker. However, I get a models error and cannot run the upgrade head. To solve this, I tried to modify the import statement. But I can't solve it at all. What should I do?

.PHONY: alembic.run
alembic.run:  ## run alembic
    @docker run --rm -it \
        --env-file $(ENVFILE_FOLDER)/.alembic \
        --net $(DOCKER_NETWORK) \
        --name $(ALEMBIC_CONTAINER) \
        --volume $(ALEMBIC_FOLDER)/alembic:/workspace/alembic:rw \
        $(ALEMBIC_CONTAINER) alembic $(cmd)
from models.db import Base
ModuleNotFoundError: No module named 'models'
make: *** [Makefile:68: alembic.run] Error 1

I have made several attempts to change the import statement in env.py and run it. However, I cannot solve the problem at all. Maybe it's a bad folder configuration. For the execution environment, arbitrary values are assigned to environment variables. The program is also executed using make file.

enter image description here enter image description here enter image description here

michi
  • 63
  • 1
  • 4
  • Please [edit] to convert your images of text into actual text. [See here](https://meta.stackoverflow.com/a/285557/20170164) for why. – rainbow.gekota Nov 07 '22 at 07:36

0 Answers0