mirror of
https://github.com/immich-app/immich.git
synced 2025-12-21 17:25:35 +03:00
chore: migrate database files (#8126)
This commit is contained in:
27
server/src/migrations/1679751316282-UpdateTranscodeOption.ts
Normal file
27
server/src/migrations/1679751316282-UpdateTranscodeOption.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
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'`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user