diff --git a/kong/cli/utils/signal.lua b/kong/cli/utils/signal.lua index c74786b78e88..7118915258d4 100644 --- a/kong/cli/utils/signal.lua +++ b/kong/cli/utils/signal.lua @@ -166,15 +166,16 @@ local function prepare_database(args_config) cutils.logger:error_exit(err) elseif keyspace == nil then cutils.logger:info("Database not initialized. Running migrations...") - local migrations = require("kong.tools.migrations")(dao_factory, cutils.get_luarocks_install_dir()) - migrations:migrate(function(migration, err) - if err then - cutils.logger:error_exit(err) - elseif migration then - cutils.logger:success("Migrated up to: "..cutils.colors.yellow(migration.name)) - end - end) end + + local migrations = require("kong.tools.migrations")(dao_factory, cutils.get_luarocks_install_dir()) + migrations:migrate(function(migration, err) + if err then + cutils.logger:error_exit(err) + elseif migration then + cutils.logger:success("Migrated up to: "..cutils.colors.yellow(migration.name)) + end + end) end local function stop_dnsmasq(kong_config)