mirror of
https://github.com/immich-app/immich.git
synced 2025-07-03 21:40:00 +02:00
refactor(server): startup checks for vector extension (#11559)
* update update logic refactor * update tests * get version range through repo method, make tests more static * move "should work" test
This commit is contained in:
parent
9765ccb5a7
commit
d5b23373c7
5 changed files with 390 additions and 366 deletions
server/src/interfaces
|
@ -28,6 +28,11 @@ export const EXTENSION_NAMES: Record<DatabaseExtension, string> = {
|
|||
vectors: 'pgvecto.rs',
|
||||
} as const;
|
||||
|
||||
export interface ExtensionVersion {
|
||||
availableVersion: string | null;
|
||||
installedVersion: string | null;
|
||||
}
|
||||
|
||||
export interface VectorUpdateResult {
|
||||
restartRequired: boolean;
|
||||
}
|
||||
|
@ -35,9 +40,10 @@ export interface VectorUpdateResult {
|
|||
export const IDatabaseRepository = 'IDatabaseRepository';
|
||||
|
||||
export interface IDatabaseRepository {
|
||||
getExtensionVersion(extensionName: string): Promise<string | undefined>;
|
||||
getAvailableExtensionVersion(extension: DatabaseExtension): Promise<string | undefined>;
|
||||
getExtensionVersion(extension: DatabaseExtension): Promise<ExtensionVersion>;
|
||||
getExtensionVersionRange(extension: VectorExtension): string;
|
||||
getPostgresVersion(): Promise<string>;
|
||||
getPostgresVersionRange(): string;
|
||||
createExtension(extension: DatabaseExtension): Promise<void>;
|
||||
updateExtension(extension: DatabaseExtension, version?: string): Promise<void>;
|
||||
updateVectorExtension(extension: VectorExtension, version?: string): Promise<VectorUpdateResult>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue