From e736b5cb032edd2517428a496423f9e4cd330b46 Mon Sep 17 00:00:00 2001 From: suika Date: Thu, 30 Jun 2022 15:31:10 +0800 Subject: [PATCH] fix migration --- kong/db/migrations/core/016_280_to_300.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kong/db/migrations/core/016_280_to_300.lua b/kong/db/migrations/core/016_280_to_300.lua index 438cf06a14e2..c9d7010c32ea 100644 --- a/kong/db/migrations/core/016_280_to_300.lua +++ b/kong/db/migrations/core/016_280_to_300.lua @@ -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 @@ -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 @@ -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 @@ -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