diff --git a/cmd/atlas/internal/cmdapi/schema.go b/cmd/atlas/internal/cmdapi/schema.go index 41632fd346a..4c05f427115 100644 --- a/cmd/atlas/internal/cmdapi/schema.go +++ b/cmd/atlas/internal/cmdapi/schema.go @@ -59,9 +59,10 @@ func (f *schemaApplyFlags) check(env *Env) error { switch { case f.url == "": return errors.New(`required flag(s) "url" not set`) - case f.planURL != "" && len(f.toURLs) == 0: - return errors.New(`the flag "to" is required to verify the provided plan`) case len(f.paths) == 0 && len(f.toURLs) == 0: + if f.planURL != "" { + return errors.New(`the flag "to" is required to verify the provided plan`) + } return errors.New(`one of flag(s) "file" or "to" is required`) case f.txMode != txModeNone && f.txMode != txModeFile: return fmt.Errorf("unknown tx-mode %q", f.txMode)