Skip to content

Commit

Permalink
fix migration
Browse files Browse the repository at this point in the history
  • Loading branch information
StarlightIbuki committed Jul 4, 2022
1 parent 9cc784b commit e736b5c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kong/db/migrations/core/016_280_to_300.lua
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ do
end
end

local function is_regex(path)
local function is_not_regex(path)
return (re_find(path, [[[a-zA-Z0-9\.\-_~/%]*$]], "ajo"))
end

Expand All @@ -304,7 +304,7 @@ local function c_normalize_regex_path(coordinator)

local changed = false
for i, path in ipairs(route.paths) do
if not is_regex(path) then
if is_not_regex(path) then
goto continue
end

Expand All @@ -318,7 +318,7 @@ local function c_normalize_regex_path(coordinator)

if changed then
local _, err = coordinator:execute(
"UPDATE routes SET path = ? WHERE partition = 'routes' AND id = ?",
"UPDATE routes SET paths = ? WHERE partition = 'routes' AND id = ?",
{ cassandra.list(route.paths), cassandra.uuid(route.id) }
)
if err then
Expand All @@ -342,7 +342,7 @@ local function p_migrate_regex_path(connector)

local changed = false
for i, path in ipairs(route.paths) do
if not is_regex(path) then
if is_not_regex(path) then
goto continue
end

Expand Down

0 comments on commit e736b5c

Please sign in to comment.