Skip to content

Commit

Permalink
fix migration
Browse files Browse the repository at this point in the history
  • Loading branch information
StarlightIbuki committed Jun 30, 2022
1 parent 14084ec commit 4bb71f0
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 4bb71f0

Please sign in to comment.