Qfix: Extend patch version values range in PG (#7005)
Some checks are pending
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
CI / formatting (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions

Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
Alexey Zinoviev 2024-10-21 16:18:30 +04:00 committed by GitHub
parent f06a6e2bc8
commit 8edf748d30
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 2 deletions

View File

@ -531,7 +531,7 @@ export class PostgresAccountDB implements AccountDB {
}
protected getMigrations (): [string, string][] {
return [this.getV1Migration()]
return [this.getV1Migration(), this.getV2Migration()]
}
// NOTE: NEVER MODIFY EXISTING MIGRATIONS. IF YOU NEED TO ADJUST THE SCHEMA, ADD A NEW MIGRATION.
@ -627,4 +627,15 @@ export class PostgresAccountDB implements AccountDB {
`
]
}
private getV2Migration (): [string, string] {
return [
'account_db_v2_fix_workspace',
`
/* ======= WORKSPACE ======= */
ALTER TABLE workspace ALTER COLUMN "versionPatch" type INT4;
`
]
}
}

View File

@ -138,7 +138,15 @@ export function withRetryConnUntilTimeout<P extends any[], T> (
export function withRetryConnUntilSuccess<P extends any[], T> (
f: (...params: P) => Promise<T>
): (...params: P) => Promise<T> {
const shouldFail = (err: any): boolean => err?.cause?.code !== 'ECONNRESET' && err?.cause?.code !== 'ECONNREFUSED'
const shouldFail = (err: any): boolean => {
const res = err?.cause?.code !== 'ECONNRESET' && err?.cause?.code !== 'ECONNREFUSED'
if (res) {
console.error('Failing withRetryConnUntilSuccess with error cause:', err?.cause)
}
return res
}
return withRetry(f, shouldFail)
}