@@ -26,6 +26,7 @@ func buildApplyCmd() *cobra.Command {
2626 "Specify the hazards that are allowed. Order does not matter, and duplicates are ignored. If the" +
2727 " migration plan contains unwanted hazards (hazards not in this list), then the migration will fail to run" +
2828 " (example: --allowed-hazards DELETES_DATA,INDEX_BUILD)" )
29+ skipConfirmPrompt := cmd .Flags ().Bool ("skip-confirm-prompt" , false , "Skips prompt asking for user to confirm before applying" )
2930 cmd .RunE = func (cmd * cobra.Command , args []string ) error {
3031 logger := log .SimpleLogger ()
3132 connConfig , err := parseConnConfig (* connFlags , logger )
@@ -54,13 +55,16 @@ func buildApplyCmd() *cobra.Command {
5455 if err := failIfHazardsNotAllowed (plan , * allowedHazardsTypesStrs ); err != nil {
5556 return err
5657 }
57- if err := mustContinuePrompt (
58- fmt .Sprintf (
59- "Apply migration with the following hazards: %s?" ,
60- strings .Join (* allowedHazardsTypesStrs , ", " ),
61- ),
62- ); err != nil {
63- return err
58+
59+ if ! * skipConfirmPrompt {
60+ if err := mustContinuePrompt (
61+ fmt .Sprintf (
62+ "Apply migration with the following hazards: %s?" ,
63+ strings .Join (* allowedHazardsTypesStrs , ", " ),
64+ ),
65+ ); err != nil {
66+ return err
67+ }
6468 }
6569
6670 if err := runPlan (context .Background (), connConfig , plan ); err != nil {
0 commit comments