Skip to content
Permalink
Browse files

fix(db) fix index in create expressions in postgres strategy (#4078)

The bug manifested itself when creating a custom DAO entity with only two fields, both of them being in a composity primary key.
  • Loading branch information...
bungle authored and hishamhm committed Dec 13, 2018
1 parent 6ac7a2b commit 4ef9df5e09eb1a771b8f32e45de2cd39ba807a2a
Showing with 3 additions and 2 deletions.
  1. +3 −2 kong/db/strategies/postgres/init.lua
@@ -1196,7 +1196,7 @@ function _M.new(connector, schema, errors)
update_args_names[i] = update_names[i]
end

local create_count = fields_count + 1
local create_count = fields_count

local cache_key_escaped
local cache_key_index
@@ -1215,8 +1215,8 @@ function _M.new(connector, schema, errors)
field_type_to_postgres_type({ type = "string" }),
}

create_expressions[create_count] = concat(create_expression)
create_count = create_count + 1
create_expressions[create_count] = concat(create_expression)
end

local ttl_escaped
@@ -1236,6 +1236,7 @@ function _M.new(connector, schema, errors)
field_type_to_postgres_type({ timestamp = true }),
}

create_count = create_count + 1
create_expressions[create_count] = concat(create_expression)
end

0 comments on commit 4ef9df5

Please sign in to comment.
You can’t perform that action at this time.