Files
immich/server/libs/infra/src/db/migrations/1679751316282-UpdateTranscodeOption.ts
Sergey Kondrikov 2c67090e3c feat(server): add transcode presets (#2084)
* feat: add transcode presets

* Add migration

* chore: generate api

* refactor: use enum type instead of string for transcode option

* chore: generate api

* refactor: enhance readability of runVideoEncode method

* refactor: reuse SettingSelect for transcoding presets

* refactor: simplify return statement

* chore: regenerate api

* fix: correct label attribute

* Update import

* fix test

---------

Co-authored-by: Alex <alex.tran1502@gmail.com>
2023-03-28 14:03:43 -05:00

28 lines
828 B
TypeScript

import { MigrationInterface, QueryRunner } from 'typeorm';
export class UpdateTranscodeOption1679751316282 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
UPDATE system_config
SET
key = 'ffmpeg.transcode',
value = '"all"'
WHERE
key = 'ffmpeg.transcodeAll' AND value = 'true'
`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
UPDATE system_config
SET
key = 'ffmpeg.transcodeAll',
value = 'true'
WHERE
key = 'ffmpeg.transcode' AND value = '"all"'
`);
await queryRunner.query(`DELETE FROM "system_config" WHERE key = 'ffmpeg.transcode'`);
}
}