Skip to content

Commit

Permalink
fix 1444 PR comment
Browse files Browse the repository at this point in the history
* mistake made with schema update, a new migration should be added, not current ones renamed
* the `down` portion reverts this value to schema 004
  • Loading branch information
toni-sharpe committed Sep 3, 2024
1 parent 03c4c76 commit 2bbb5e7
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions db/migration/1721137710002-UpdateSchemaForChartConfigChange.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { MigrationInterface, QueryRunner } from "typeorm"

export class UpdateSchemaForChartConfigChange
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`-- sql
UPDATE charts
SET config = JSON_SET(config, '$.$schema', 'https://files.ourworldindata.org/schemas/grapher-schema.005.json');
`)
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`-- sql
UPDATE charts
SET config = JSON_SET(config, '$.$schema', 'https://files.ourworldindata.org/schemas/grapher-schema.004.json');
`)
}
}

0 comments on commit 2bbb5e7

Please sign in to comment.