chore(server): startup check for pgvecto.rs (#5815)

* startup check for pgvecto.rs

* prefilter after assertion

* formatting

* add assert to migration

* more specific import

* use runner
This commit is contained in:
Mert 2023-12-18 11:38:25 -05:00 committed by GitHub
parent fade8b627f
commit de1514a441
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 53 additions and 15 deletions

View file

@ -1,6 +1,6 @@
import { AssetCreate, IJobRepository, JobItem, JobItemHandler, LibraryResponseDto, QueueName } from '@app/domain';
import { AppModule } from '@app/immich';
import { dataSource } from '@app/infra';
import { dataSource, databaseChecks } from '@app/infra';
import { AssetEntity, AssetType, LibraryType } from '@app/infra/entities';
import { INestApplication } from '@nestjs/common';
import { Test } from '@nestjs/testing';
@ -22,11 +22,7 @@ export interface ResetOptions {
}
export const db = {
reset: async (options?: ResetOptions) => {
if (!dataSource.isInitialized) {
await dataSource.initialize();
}
await dataSource.query(`SET vectors.enable_prefilter = on`);
await databaseChecks();
await dataSource.transaction(async (em) => {
const entities = options?.entities || [];
const tableNames =