-
-
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.
🐛 allow single-entity selection for charts split by metric
- Loading branch information
1 parent
4d6453e
commit 7218646
Showing
2 changed files
with
27 additions
and
8 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
db/migration/1737580227406-RetainMultiEntitySelectionForChartsSplitByMetric.ts
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,23 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm" | ||
|
||
export class RetainMultiEntitySelectionForChartsSplitByMetric1737580227406 | ||
implements MigrationInterface | ||
{ | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
// Charts faceted by metric used to ignore the 'change-country' setting | ||
// and offer multi-entity selection always. The code change that comes | ||
// with this migration makes it so that the 'change-country' setting | ||
// is respected. This migration updates all existing charts that relied | ||
// on the old behavior to use the 'add-country' setting explicitly. | ||
await queryRunner.query(` | ||
UPDATE chart_configs | ||
SET | ||
patch = JSON_SET(patch, '$.addCountryMode', 'add-country'), | ||
full = JSON_SET(full, '$.addCountryMode', 'add-country') | ||
WHERE full ->> '$.addCountryMode' = 'change-country' | ||
AND full ->> '$.selectedFacetStrategy' = 'metric'; | ||
`) | ||
} | ||
|
||
public async down(): Promise<void> {} | ||
Check warning on line 22 in db/migration/1737580227406-RetainMultiEntitySelectionForChartsSplitByMetric.ts GitHub Actions / eslint
|
||
} |
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