Is there a way to automatically specify YES as the default option on
manage.py makemigrations myAPp and
manage.py migrate commands
i tried the --noinput option on migrate but i think it defaults to NO not YES
makemigrations is responsible for packaging up your model changes into individual migration files - analogous to commits - and migrate is responsible for applying those to your database.
Migrations are one of the great features that come out of the box with Django. It automates the process of changing database after modifications in the models. With few simple commands, model changes will reflect in the database. For example, In a model named Image, we add a new field called file_size.
If dropping your database is not an option then the next best solution is to find the last working state of the database and then create new migration files. Find the last good state where your database was working. Delete all the files from the migrations folder. Uncomment the changes which you did in step 2.
found the answer on another question
You can use the 'yes' command which passes a 'y' to all questions
yes | python manage.py makemigrations myApp
if you want to edit the response (i.e send a 'yes' instead of 'y') you can add it as a parameter
yes yes | python manage.py migrate
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With