Updating environments which need to re-sync definitions.
This commit is contained in:
parent
00eba1bd35
commit
048d15956b
|
@ -38,6 +38,7 @@ import {
|
|||
} from "./filters"
|
||||
|
||||
const builder = new sql.Sql(SqlClient.SQL_LITE)
|
||||
const NO_SUCH_COLUMN_REGEX = new RegExp(`no such colum.+${USER_COLUMN_PREFIX}`)
|
||||
|
||||
function buildInternalFieldList(
|
||||
table: Table,
|
||||
|
@ -329,7 +330,10 @@ export async function search(
|
|||
return response
|
||||
} catch (err: any) {
|
||||
const msg = typeof err === "string" ? err : err.message
|
||||
if (err.status === 404 && msg?.includes(SQLITE_DESIGN_DOC_ID)) {
|
||||
const syncAndRepeat =
|
||||
(err.status === 400 && msg?.match(NO_SUCH_COLUMN_REGEX)) ||
|
||||
(err.status === 404 && msg?.includes(SQLITE_DESIGN_DOC_ID))
|
||||
if (syncAndRepeat) {
|
||||
await sdk.tables.sqs.syncDefinition()
|
||||
return search(options, table)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue