diff --git a/db/migration/1725540224795-CleanUpChartConfigStackMode.ts b/db/migration/1725540224795-CleanUpChartConfigStackMode.ts new file mode 100644 index 00000000000..0686bb9a529 --- /dev/null +++ b/db/migration/1725540224795-CleanUpChartConfigStackMode.ts @@ -0,0 +1,21 @@ +import { MigrationInterface, QueryRunner } from "typeorm" + +export class CleanUpChartConfigStackMode1725540224795 + implements MigrationInterface +{ + public async up(queryRunner: QueryRunner): Promise { + 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 {} +} diff --git a/devTools/schemaProcessor/columns.json b/devTools/schemaProcessor/columns.json index ef55467b8bb..4fde4cd7362 100644 --- a/devTools/schemaProcessor/columns.json +++ b/devTools/schemaProcessor/columns.json @@ -653,10 +653,10 @@ "editor": "checkbox" }, { - "type": ["string", "null"], + "type": "string", "pointer": "/stackMode", "editor": "textfield", - "enumOptions": ["absolute", "relative", "grouped", "stacked", null] + "enumOptions": ["absolute", "relative"] }, { "type": ["string", "number"],