Skip to content

Commit

Permalink
fix(migrations) enabling auto migrations on start
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaultcha committed Jun 5, 2015
1 parent 486f374 commit 48f9a31
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions kong/cli/utils/signal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 48f9a31

Please sign in to comment.