Skip to content

Commit e61bda7

Browse files
authored
Merge pull request #1183 from Whiznificent/main
feat(data-export): Add export artifact integrity checks
2 parents 95c1f0f + 7524fae commit e61bda7

4 files changed

Lines changed: 621 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { MigrationInterface, QueryRunner } from 'typeorm';
2+
3+
/**
4+
* Migration: Add export artifact integrity fields to data_export_requests.
5+
*
6+
* Adds:
7+
* - `checksum` VARCHAR(64) – SHA-256 hex digest of the ZIP artifact
8+
* - `fileSize` BIGINT – size of the artifact in bytes
9+
*
10+
* Both columns are nullable so existing rows are unaffected.
11+
*/
12+
export class AddExportArtifactIntegrity1800100000000
13+
implements MigrationInterface
14+
{
15+
public async up(queryRunner: QueryRunner): Promise<void> {
16+
await queryRunner.query(`
17+
ALTER TABLE "data_export_requests"
18+
ADD COLUMN IF NOT EXISTS "checksum" VARCHAR(64),
19+
ADD COLUMN IF NOT EXISTS "fileSize" BIGINT
20+
`);
21+
}
22+
23+
public async down(queryRunner: QueryRunner): Promise<void> {
24+
await queryRunner.query(`
25+
ALTER TABLE "data_export_requests"
26+
DROP COLUMN IF EXISTS "checksum",
27+
DROP COLUMN IF EXISTS "fileSize"
28+
`);
29+
}
30+
}

0 commit comments

Comments
 (0)