mirror of
https://github.com/immich-app/immich.git
synced 2025-03-11 02:23:09 -05:00
* rename thumbnail config update target paths, fix tests rename to image settings replace legacy enum better typing update sql update api remove config option fix * update docs * update other thumbnail configs in migration * keep legacy enum for now * fix jumbled job names * fix jumbled job names in tests * rename thumbhash job * rename dto * fix tests * preserve order * remove unused import * keep old fields in dto, marked deprecated * update sql --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
51 lines
1.6 KiB
TypeScript
51 lines
1.6 KiB
TypeScript
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
export class RenameWebpJpegPaths1711257900274 implements MigrationInterface {
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.renameColumn('assets', 'webpPath', 'thumbnailPath');
|
|
await queryRunner.renameColumn('assets', 'resizePath', 'previewPath');
|
|
await queryRunner.query(`
|
|
UPDATE system_config
|
|
SET key = 'image.previewSize'
|
|
WHERE key = 'thumbnail.jpegSize'`);
|
|
await queryRunner.query(
|
|
`UPDATE system_config
|
|
SET key = 'image.thumbnailSize'
|
|
WHERE key = 'thumbnail.webpSize'`,
|
|
);
|
|
await queryRunner.query(
|
|
`UPDATE system_config
|
|
SET key = 'image.quality'
|
|
WHERE key = 'thumbnail.quality'`,
|
|
);
|
|
await queryRunner.query(
|
|
`UPDATE system_config
|
|
SET key = 'image.colorspace'
|
|
WHERE key = 'thumbnail.colorspace'`,
|
|
);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.renameColumn('assets', 'thumbnailPath', 'webpPath');
|
|
await queryRunner.renameColumn('assets', 'previewPath', 'resizePath');
|
|
await queryRunner.query(`
|
|
UPDATE system_config
|
|
SET key = 'thumbnail.jpegSize'
|
|
WHERE key = 'image.previewSize'`);
|
|
await queryRunner.query(
|
|
`UPDATE system_config
|
|
SET key = 'thumbnail.webpSize'
|
|
WHERE key = 'image.thumbnailSize'`,
|
|
);
|
|
await queryRunner.query(
|
|
`UPDATE system_config
|
|
SET key = 'thumbnail.quality'
|
|
WHERE key = 'image.quality'`,
|
|
);
|
|
await queryRunner.query(
|
|
`UPDATE system_config
|
|
SET key = 'thumbnail.colorspace'
|
|
WHERE key = 'image.colorspace'`,
|
|
);
|
|
}
|
|
}
|