From c930381e24311e54cd9f731a391c36267f002ed1 Mon Sep 17 00:00:00 2001 From: Thibault Charbonnier Date: Thu, 9 Apr 2015 23:09:31 +0200 Subject: [PATCH] fix: Makefile with new migrations command --- Makefile | 8 ++++---- src/dao/schemas.lua | 2 +- src/vendor/lapp.lua | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 659133d4cd52..91782c660698 100644 --- a/Makefile +++ b/Makefile @@ -22,15 +22,15 @@ dev: echo "$$rock already installed, skipping" ; \ fi \ done; - bin/kong config -e TEST - bin/kong config -e DEVELOPMENT - bin/kong db -c $(DEVELOPMENT_CONF) migrations:up + bin/kong config -c kong.yml -e TEST + bin/kong config -c kong.yml -e DEVELOPMENT + bin/kong migrations -c $(DEVELOPMENT_CONF) up clean: @rm -f luacov.* @rm -f $(DEVELOPMENT_CONF) $(TESTING_CONF) @rm -rf nginx_tmp - @bin/kong db -c $(DEVELOPMENT_CONF) migrations:reset + @bin/kong migrations -c $(DEVELOPMENT_CONF) reset run: @bin/kong start -c $(DEVELOPMENT_CONF) diff --git a/src/dao/schemas.lua b/src/dao/schemas.lua index 5ac43891dbc6..13eadd917b8a 100644 --- a/src/dao/schemas.lua +++ b/src/dao/schemas.lua @@ -40,7 +40,7 @@ function _M.validate(t, schema, is_update) -- Check the given table against a given schema for column, v in pairs(schema) do - -- Set default value for the filed if given + -- Set default value for the field if given if t[column] == nil and v.default ~= nil then if type(v.default) == "function" then t[column] = v.default() diff --git a/src/vendor/lapp.lua b/src/vendor/lapp.lua index e705ecde9fb4..cb7420e19449 100644 --- a/src/vendor/lapp.lua +++ b/src/vendor/lapp.lua @@ -53,7 +53,7 @@ local function quit(msg,no_usage) end local function error(msg,no_usage) - quit(msg,no_usage) + quit(arg[0]:gsub('.+[\\/]','')..':'..msg,no_usage) end local function ltrim(line) @@ -68,7 +68,7 @@ local function trim(s) return ltrim(rtrim(s)) end -local function open(file,opt) +local function open (file,opt) local val,err = io.open(file,opt) if not val then error(err,true) end append(open_files,val) @@ -122,7 +122,7 @@ local function force_short(short) xassert(#short==1,short..": short parameters should be one character") end -function process_options_string(str, main_command) +function process_options_string(str) local res = {} local varargs @@ -297,8 +297,8 @@ function process_options_string(str, main_command) -- check unused parms, set defaults and check if any required parameters were missed for parm,ps in pairs(parms) do if not ps.used then - if ps.required then error("Missing required parameter: "..parm) end - set_result(parm,ps.defval) + if ps.required then error("missing required parameter: "..parm) end + set_result(ps,parm,ps.defval) end end return res