Skip to content

Commit

Permalink
fix 1444 had to incorporate new DB changes
Browse files Browse the repository at this point in the history
* the chart config moved so now the focus is on a specific chart_configs table, not the charts table
* didn't see the need to restrict by type, it would be a slower query,
* did away with all the 005 schema stuff, assuming the new chart stuff covered that (my merge issues suggest this in fact)
  • Loading branch information
toni-sharpe committed Sep 7, 2024
1 parent 6e54cca commit c89eff0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@ import { MigrationInterface, QueryRunner } from "typeorm"
export class RemoveHideLinesOutsideToleranceFromConfig1725540224800
implements MigrationInterface
{
private remove_hide_lines_outside_tolerance(field: string) {
return `${field} = JSON_REMOVE(
${field},
'$."hideLinesOutsideTolerance"'
)`
}

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`-- sql
UPDATE charts
SET config = JSON_REMOVE(config, '$."hideLinesOutsideTolerance"')
WHERE
type = "ScatterPlot"
UPDATE
chart_configs
SET
${this.remove_hide_lines_outside_tolerance('full')},
${this.remove_hide_lines_outside_tolerance('patch')}
`)
}

Expand Down
19 changes: 0 additions & 19 deletions db/migration/1725540224801-UpdateSchemaForChartConfigChange.ts

This file was deleted.

0 comments on commit c89eff0

Please sign in to comment.