migration fixes
This commit is contained in:
parent
7e65dcabc1
commit
375d0320fc
2 changed files with 3 additions and 3 deletions
|
@ -33,7 +33,7 @@ export async function initDataSource(): Promise<DataSource> {
|
||||||
const dataSource = await new DataSource(databaseConfig).initialize();
|
const dataSource = await new DataSource(databaseConfig).initialize();
|
||||||
|
|
||||||
const hasVectorExtension = (await dataSource.query(
|
const hasVectorExtension = (await dataSource.query(
|
||||||
`SELECT * FROM pg_extension WHERE name = 'vectors'`,
|
`SELECT * FROM pg_available_extensions WHERE name = 'vectors'`,
|
||||||
)).length > 0;
|
)).length > 0;
|
||||||
|
|
||||||
if (hasVectorExtension) {
|
if (hasVectorExtension) {
|
||||||
|
|
|
@ -5,11 +5,11 @@ export class UsePgVectors1699746198141 implements MigrationInterface {
|
||||||
|
|
||||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
const faceDimQuery = await queryRunner.query(`
|
const faceDimQuery = await queryRunner.query(`
|
||||||
SELECT CARDINALITY(embedding) as dimsize
|
SELECT CARDINALITY(embedding::real[]) as dimsize
|
||||||
FROM asset_faces
|
FROM asset_faces
|
||||||
LIMIT 1`);
|
LIMIT 1`);
|
||||||
const clipDimQuery = await queryRunner.query(`
|
const clipDimQuery = await queryRunner.query(`
|
||||||
SELECT CARDINALITY("clipEmbedding") as dimsize
|
SELECT CARDINALITY("clipEmbedding"::real[]) as dimsize
|
||||||
FROM smart_info
|
FROM smart_info
|
||||||
LIMIT 1`);
|
LIMIT 1`);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue