18

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

Dhanushka Amarakoon
  • 3,502
  • 5
  • 31
  • 43
  • Possible duplicate of [django makemigrations to rename field without user input](http://stackoverflow.com/questions/39866339/django-makemigrations-to-rename-field-without-user-input) – Sardorbek Imomaliev Oct 12 '16 at 05:25

2 Answers2

22

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
Dhanushka Amarakoon
  • 3,502
  • 5
  • 31
  • 43
21

Your migrations should run with the --noinput flag.

You may want to make sure you're migrating the same app that you've created the migrations for.

Try running python manage.py showmigrations before and after running your migrations to see what's going on.

jamjar
  • 625
  • 5
  • 13