aviskarkc10 · GitHub

I am trying to initialize my migration inside a docker image with the command:
alembic init {dir_name}

For this I will have to map the volume in my system as follows:

docker run -it -v $(pwd)/migrations:/app/migrations {docker_image_name} alembic init migrations

But this throws the error FAILED: Directory migrations already exists because we are checking the following condition:

if os.access(directory, os.F_OK):
        raise util.CommandError("Directory %s already exists" % directory)

Because of this, I won't be able to initialize my migrations as without volume mapping there is no way to persist the migrations folder in my system.

Is there any reason why we are doing so?
Maybe we should change this implementation to ask the user if they want to overwrite their current migrations?

Read the original on github.com ↗