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