-
-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 (grapher) delete stackMode=null from chart configs
- Loading branch information
1 parent
0a61d87
commit 5037f76
Showing
2 changed files
with
23 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm" | ||
|
||
export class CleanUpChartConfigStackMode1725540224795 | ||
implements MigrationInterface | ||
{ | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`-- sql | ||
UPDATE chart_configs cc | ||
JOIN charts c ON c.configId = cc.id | ||
SET | ||
-- remove NULLs from the patch config | ||
cc.patch = JSON_REMOVE(cc.patch, '$.stackMode'), | ||
-- replace NULLs with the default value in the full config | ||
cc.full = JSON_REPLACE(cc.full, '$.stackMode', 'absolute') | ||
WHERE cc.patch ->> '$.stackMode' = 'null' | ||
`) | ||
} | ||
|
||
// eslint-disable-next-line | ||
public async down(queryRunner: QueryRunner): Promise<void> {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters