deployment - Django: How to write migrations that don't require keyboard input? -
i'm wondering if there's way write migrations won't ask me input @ terminal. example, while writing migration deletes model, django asks me confirm @ command line yes/no. want avoid these prompts because same code used automatic deployments (can't type in prompts during automatic deployment).
i'm aware there's noinput
option. i'm more interested in learning how write migrations don't require keyboard input, if possible. i've noted when using option, prompted anyway (one example comes mind migration asked me input default data new columns being added model; noinput
didn't stop django asking input anyway).
there 2 situations here: makemigrations
, migrate
.
migrate
100% covered --noinput
option: unless install custom, third-party pre/post migrate signal hook ignores option, you'll no user prompts option.
makemigrations
not 100% covered --noinput
option, , while it's nice-to-have, it's absolutely not necessary. migrations should always created , tested in development environment. i've yet see development environment can't provide manual input.
1.9 in time introduce better support --noinput
in combination makemigrations
(at moment, supports --noinput
in combination --merge
).
Comments
Post a Comment