mirror of
https://github.com/samsonjs/immich.git
synced 2026-04-27 15:07:45 +00:00
feat: support database dumps for pg18 (#23186)
This commit is contained in:
parent
b6cebb3ece
commit
9b58d5663a
2 changed files with 3 additions and 2 deletions
|
|
@ -209,6 +209,7 @@ describe(BackupService.name, () => {
|
||||||
${'15.3.3'} | ${15}
|
${'15.3.3'} | ${15}
|
||||||
${'16.4.2'} | ${16}
|
${'16.4.2'} | ${16}
|
||||||
${'17.15.1'} | ${17}
|
${'17.15.1'} | ${17}
|
||||||
|
${'18.0.0'} | ${18}
|
||||||
`(
|
`(
|
||||||
`should use pg_dumpall $expectedVersion with postgres version $postgresVersion`,
|
`should use pg_dumpall $expectedVersion with postgres version $postgresVersion`,
|
||||||
async ({ postgresVersion, expectedVersion }) => {
|
async ({ postgresVersion, expectedVersion }) => {
|
||||||
|
|
@ -224,7 +225,7 @@ describe(BackupService.name, () => {
|
||||||
it.each`
|
it.each`
|
||||||
postgresVersion
|
postgresVersion
|
||||||
${'13.99.99'}
|
${'13.99.99'}
|
||||||
${'18.0.0'}
|
${'19.0.0'}
|
||||||
`(`should fail if postgres version $postgresVersion is not supported`, async ({ postgresVersion }) => {
|
`(`should fail if postgres version $postgresVersion is not supported`, async ({ postgresVersion }) => {
|
||||||
mocks.database.getPostgresVersion.mockResolvedValue(postgresVersion);
|
mocks.database.getPostgresVersion.mockResolvedValue(postgresVersion);
|
||||||
const result = await sut.handleBackupDatabase();
|
const result = await sut.handleBackupDatabase();
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ export class BackupService extends BaseService {
|
||||||
const databaseSemver = semver.coerce(databaseVersion);
|
const databaseSemver = semver.coerce(databaseVersion);
|
||||||
const databaseMajorVersion = databaseSemver?.major;
|
const databaseMajorVersion = databaseSemver?.major;
|
||||||
|
|
||||||
if (!databaseMajorVersion || !databaseSemver || !semver.satisfies(databaseSemver, '>=14.0.0 <18.0.0')) {
|
if (!databaseMajorVersion || !databaseSemver || !semver.satisfies(databaseSemver, '>=14.0.0 <19.0.0')) {
|
||||||
this.logger.error(`Database Backup Failure: Unsupported PostgreSQL version: ${databaseVersion}`);
|
this.logger.error(`Database Backup Failure: Unsupported PostgreSQL version: ${databaseVersion}`);
|
||||||
return JobStatus.Failed;
|
return JobStatus.Failed;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue