Module: Twenty::Command::Hook::RequireMigration

Included in:
Connect, Console, Disconnect, Up
Defined in:
lib/twenty/cli/command/hook/require_migration.rb

Constant Summary collapse

Error =
Class.new(RuntimeError)

Instance Method Summary collapse

Instance Method Details

#run_commandObject



7
8
9
10
11
12
13
14
# File 'lib/twenty/cli/command/hook/require_migration.rb', line 7

def run_command(...)
  if pending_migrations?
    raise Error, "There are pending database migrations to run. \n" \
                 "Try 'twenty migrate'"
  else
    super(...)
  end
end