cli: add 'pending_migrations?' shortcut
This commit is contained in:
parent
4e483ccf17
commit
52297a2556
1 changed files with 6 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
||||||
module Twenty::Command::PendingMigrationMixin
|
module Twenty::Command::PendingMigrationMixin
|
||||||
def run_command(...)
|
def run_command(...)
|
||||||
if Twenty::Migration.pending_migrations?
|
if pending_migrations?
|
||||||
warn "There are pending migrations.\n" \
|
warn "There are pending migrations.\n" \
|
||||||
"Run \"twenty migrate\" first.\n"
|
"Run \"twenty migrate\" first.\n"
|
||||||
exit(1)
|
exit(1)
|
||||||
|
@ -8,4 +8,9 @@ module Twenty::Command::PendingMigrationMixin
|
||||||
super(...)
|
super(...)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
private
|
||||||
|
|
||||||
|
def pending_migrations?
|
||||||
|
Twenty::Migration.pending_migrations?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue