Skip to content

Commit

Permalink
🎉 add cloudflareId to images table
Browse files Browse the repository at this point in the history
  • Loading branch information
ikesau committed Nov 12, 2024
1 parent a22452e commit 584a06c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions db/migration/1731360326761-CloudflareImages.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { MigrationInterface, QueryRunner } from "typeorm"

export class CloudflareImages1731360326761 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`-- sql
ALTER TABLE images ADD COLUMN cloudflareId VARCHAR(255) NULL
`)
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`-- sql
ALTER TABLE images DROP COLUMN cloudflareId
`)
}
}
1 change: 1 addition & 0 deletions packages/@ourworldindata/types/src/dbTypes/Images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export interface DbInsertImage {
originalWidth?: number | null
originalHeight?: number | null
updatedAt?: string | null // MySQL Date objects round to the nearest second, whereas Google includes milliseconds so we store as an epoch of type bigint to avoid any conversion issues
cloudflareId?: string | null
}
export type DbRawImage = Required<DbInsertImage>
export type DbEnrichedImage = Omit<DbRawImage, "updatedAt"> & {
Expand Down

0 comments on commit 584a06c

Please sign in to comment.