Skip to content Skip to sidebar Skip to footer

Django Makemigrations To Rename Field Without User Input

I have a model with CharField named oldName. I want to rename the field to newName. When I run python manage.py makemigrations, I get a confirmation request 'Did you rename model.

Solution 1:

Use

script_or_command < <(yes y)

But I'm not sure this will work for multiple input prompts.


Solution 2:

Added yes and pipe | before python manage.py makemigrations to docker-compoase.yaml and it worked as shown below:

yes | python manage.py makemigrations

Post a Comment for "Django Makemigrations To Rename Field Without User Input"