mirror of
https://github.com/immich-app/immich.git
synced 2025-06-23 15:30:51 -04:00
22 lines
979 B
TypeScript
22 lines
979 B
TypeScript
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
|
|
export class RemoveTextSearchColumn1715623169039 implements MigrationInterface {
|
|
name = 'RemoveTextSearchColumn1715623169039'
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`ALTER TABLE "exif" DROP COLUMN "exifTextSearchableColumn"`);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`ALTER TABLE "exif" ADD "exifTextSearchableColumn" tsvector GENERATED ALWAYS AS (TO_TSVECTOR('english',
|
|
COALESCE(make, '') || ' ' ||
|
|
COALESCE(model, '') || ' ' ||
|
|
COALESCE(orientation, '') || ' ' ||
|
|
COALESCE("lensModel", '') || ' ' ||
|
|
COALESCE("city", '') || ' ' ||
|
|
COALESCE("state", '') || ' ' ||
|
|
COALESCE("country", ''))) STORED NOT NULL`);
|
|
}
|
|
|
|
}
|