[fix] Ask for specifying migrations to skip

This commit is contained in:
ljf 2019-08-14 13:05:23 +02:00
parent c81eab396b
commit 7a0dbf7977
2 changed files with 4 additions and 4 deletions

View file

@ -1736,10 +1736,10 @@ tools:
help: Skip specified migrations (to be used only if you know what you are doing) help: Skip specified migrations (to be used only if you know what you are doing)
action: store_true action: store_true
--revert: --revert:
help: Attempt to revert already-ran migrations (to be used only if you know what you are doing) help: Attempt to revert already-ran specified migrations (to be used only if you know what you are doing)
action: store_true action: store_true
--force-rerun: --force-rerun:
help: Re-run already-ran migrations (to be used only if you know what you are doing) help: Re-run already-ran specified migration (to be used only if you know what you are doing)
action: store_true action: store_true
--auto: --auto:
help: Automatic mode, won't run manual migrations (to be used only if you know what you are doing) help: Automatic mode, won't run manual migrations (to be used only if you know what you are doing)

View file

@ -1044,7 +1044,7 @@ def tools_migrations_migrate(targets=[], skip=False, auto=False, force_rerun=Fal
targets A list migrations to run (all pendings by default) targets A list migrations to run (all pendings by default)
--skip Skip specified migrations (to be used only if you know what you are doing) (must explicit which migrations) --skip Skip specified migrations (to be used only if you know what you are doing) (must explicit which migrations)
--auto Automatic mode, won't run manual migrations (to be used only if you know what you are doing) (must explicit which migrations) --auto Automatic mode, won't run manual migrations (to be used only if you know what you are doing)
--force-rerun Re-run already-ran migrations (to be used only if you know what you are doing)(must explicit which migrations) --force-rerun Re-run already-ran migrations (to be used only if you know what you are doing)(must explicit which migrations)
--revert Attempt to revert already-ran migrations (to be used only if you know what you are doing)(must explicit which migrations) --revert Attempt to revert already-ran migrations (to be used only if you know what you are doing)(must explicit which migrations)
--accept-disclaimer Accept disclaimers of migrations (please read them before using this option) (only valid for one migration) --accept-disclaimer Accept disclaimers of migrations (please read them before using this option) (only valid for one migration)
@ -1067,7 +1067,7 @@ def tools_migrations_migrate(targets=[], skip=False, auto=False, force_rerun=Fal
# If no target specified # If no target specified
if not targets: if not targets:
# skip, revert or force require explicit targets # skip, revert or force require explicit targets
if (revert or force_rerun): if (skip or revert or force_rerun):
raise YunohostError("migrations_must_provide_explicit_targets") raise YunohostError("migrations_must_provide_explicit_targets")
# Otherwise, targets are all pending migrations # Otherwise, targets are all pending migrations