Dhanushka Amarakoon
Dhanushka Amarakoon

Reputation: 3762

Django migrate and makemigrate automatic yes on prompt

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

Upvotes: 19

Views: 7864

Answers (2)

Dhanushka Amarakoon
Dhanushka Amarakoon

Reputation: 3762

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

Upvotes: 23

jamjar
jamjar

Reputation: 635

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.

Upvotes: 22

Related Questions