immich/server/libs/infra/src/migrations/1679751316282-UpdateTranscodeOption.ts
Jason Rasmussen 34d300d1da
refactor(server): flatten infra folders (#2120)
* refactor: flatten infra folders

* fix: database migrations

* fix: test related import

* fix: github actions workflow

* chore: rename schemas to typesense-schemas
2023-03-30 14:38:55 -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'`);
}
}