From 211de1fd5242d32d03a6d8d44d65753ccb11507a Mon Sep 17 00:00:00 2001 From: Florian M Date: Mon, 6 Sep 2021 10:43:07 +0200 Subject: [PATCH] Remove highlightHoveredCellId property from configuration of existing tasktypes (#5707) * Remove highlightHoveredCellId property from configuration of existing task types * changelog, migration guide --- CHANGELOG.unreleased.md | 2 +- MIGRATIONS.released.md | 1 + MIGRATIONS.unreleased.md | 2 ++ conf/evolutions/075-tasktype-remove-hovered-cell-id.sql | 7 +++++++ .../reversions/075-tasktype-remove-hovered-cell-id.sql | 8 ++++++++ tools/postgres/schema.sql | 2 +- 6 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 conf/evolutions/075-tasktype-remove-hovered-cell-id.sql create mode 100644 conf/evolutions/reversions/075-tasktype-remove-hovered-cell-id.sql diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 024e2edee43..1e6cc6e722d 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -17,7 +17,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released - By default, if data is missing in one magnification, higher magnifications are used for rendering. This setting can be controlled via the left sidebar under "Render Missing Data Black". [#5703](https://github.com/scalableminds/webknossos/pull/5703) ### Fixed -- +- Fixed a bug where existing tasktypes with recommended configurations still had a property that is no longer valid. [#5707](https://github.com/scalableminds/webknossos/pull/5707) ### Removed - diff --git a/MIGRATIONS.released.md b/MIGRATIONS.released.md index c558c33c5d0..3c859c4fc64 100644 --- a/MIGRATIONS.released.md +++ b/MIGRATIONS.released.md @@ -29,6 +29,7 @@ SET recommendedconfiguration = jsonb_set( to_jsonb('true'::boolean)) ``` - The health check at api/health does not longer include checking data/health and tracings/health if the respective local modules are enabled. Consider monitoring those routes separately. +- Run as sql: `UPDATE webknossos.tasktypes SET recommendedconfiguration = recommendedconfiguration - 'highlightHoveredCellId';` to avoid invalid recommended configurations in existing task types. This was added later as evolution 75, but should be run already here (note that it is idempotent). ### Postgres Evolutions: - [072-jobs-manually-repaired.sql](conf/evolutions/072-jobs-manually-repaired.sql) diff --git a/MIGRATIONS.unreleased.md b/MIGRATIONS.unreleased.md index 79f7325cea7..235daea52d4 100644 --- a/MIGRATIONS.unreleased.md +++ b/MIGRATIONS.unreleased.md @@ -8,3 +8,5 @@ User-facing changes are documented in the [changelog](CHANGELOG.released.md). ## Unreleased ### Postgres Evolutions: + +- [075-tasktype-remove-hovered-cell-id.sql](conf/evolutions/075-tasktype-remove-hovered-cell-id.sql) diff --git a/conf/evolutions/075-tasktype-remove-hovered-cell-id.sql b/conf/evolutions/075-tasktype-remove-hovered-cell-id.sql new file mode 100644 index 00000000000..ff255d83e15 --- /dev/null +++ b/conf/evolutions/075-tasktype-remove-hovered-cell-id.sql @@ -0,0 +1,7 @@ +START TRANSACTION; + +UPDATE webknossos.tasktypes SET recommendedconfiguration = recommendedconfiguration - 'highlightHoveredCellId'; + +UPDATE webknossos.releaseInformation SET schemaVersion = 75; + +COMMIT TRANSACTION; diff --git a/conf/evolutions/reversions/075-tasktype-remove-hovered-cell-id.sql b/conf/evolutions/reversions/075-tasktype-remove-hovered-cell-id.sql new file mode 100644 index 00000000000..569c634489e --- /dev/null +++ b/conf/evolutions/reversions/075-tasktype-remove-hovered-cell-id.sql @@ -0,0 +1,8 @@ +START TRANSACTION; + +# Since we are losing information when removing the property, we cannot set it in the reversion. +# However, this will not create an invalid state since the object is merged with the user config. + +UPDATE webknossos.releaseInformation SET schemaVersion = 74; + +COMMIT TRANSACTION; diff --git a/tools/postgres/schema.sql b/tools/postgres/schema.sql index ae503cc013d..63c886fe4b8 100644 --- a/tools/postgres/schema.sql +++ b/tools/postgres/schema.sql @@ -21,7 +21,7 @@ START TRANSACTION; CREATE TABLE webknossos.releaseInformation ( schemaVersion BIGINT NOT NULL ); -INSERT INTO webknossos.releaseInformation(schemaVersion) values(74); +INSERT INTO webknossos.releaseInformation(schemaVersion) values(75); COMMIT TRANSACTION;