mirror of
https://github.com/immich-app/immich.git
synced 2025-12-21 09:15:44 +03:00
chore: migrate database files (#8126)
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class AddMetadataExtractedAt1705094221536 implements MigrationInterface {
|
||||
name = 'AddMetadataExtractedAt1705094221536';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "asset_job_status" ADD "metadataExtractedAt" TIMESTAMP WITH TIME ZONE`);
|
||||
await queryRunner.query(`
|
||||
UPDATE "asset_job_status"
|
||||
SET "metadataExtractedAt" = NOW()
|
||||
FROM "exif"
|
||||
WHERE "exif"."assetId" = "asset_job_status"."assetId";
|
||||
`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "asset_job_status" DROP COLUMN "metadataExtractedAt"`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user