Repository navigation
Add --yes to skip seed and reset confirmations - #1128
Open
dereuromark wants to merge 2 commits into
Open
dereuromark wants to merge 2 commits into
dereuromark wants to merge 2 commits into
Conversation
seeds run, seeds reset and migrations reset now accept --yes (-y) to skip the confirmation prompt while keeping normal output. In non-interactive mode (-q) without --yes, seeds reset and migrations reset now exit with an error instead of answering the prompt with its default "n" and exiting 0 without doing anything. seeds run -q keeps skipping its prompt.
nook24
added a commit
to openITCOCKPIT/openITCOCKPIT
that referenced
this pull request
Nov 20, 2026
For now, we use 'yes | oitc seeds run' to execute our seeds. This will ensure that we still get back an output in case something goes wrong. As soon as cakephp/migrations#1128 gets merged, we can remove the 'yes |' workaround and use --yes instead. --force was a dirty hack to make sure that all seeds gets executed on every run (like the old migrations plugin did) We still need this behavior but the clean way is to mark the seed to be Idempotent https://book.cakephp.org/migrations/5/guides/seeding.html#idempotent-seeds
Contributor
|
Much appreciated. Currently I have to use a workaround like So a |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated deploys had no clean way past the seed and reset confirmations.
--forceonseeds rundoes not skip the prompt; it re-runs seeds that already ran. The only working option was-q, which also hides the output, and it only works forseeds run.This adds
--yes(-y) toseeds run,seeds resetandmigrations reset. It skips the prompt and keeps normal output.seeds reset -qandmigrations reset -qused to answer the prompt with its default "n", print "Reset operation aborted." and exit 0, so a CI job passed without resetting anything. Without--yesthey now fail with a non-zero exit code and tell you to pass--yes.--dry-runstill needs no confirmation, andseeds run -qstill skips its prompt as before.seeds run --yesseeds run -qseeds reset -qseeds reset -q --yesmigrations reset -qmigrations reset --yesDocs: seeding guide and a new "Non-interactive Commands" section under Deployment.
Follow-up on the core side: cakephp/cakephp draft PR adding
ConsoleIo::isInteractive()and a--no-interactionoption, so commands can check interactivity directly instead of reading--quiet.