You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2020/01/10 20:00:32 UTC

[airavata] branch airavata-3276 updated: AIRAVATA-3276 Migration script for ui config change

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch airavata-3276
in repository https://gitbox.apache.org/repos/asf/airavata.git


The following commit(s) were added to refs/heads/airavata-3276 by this push:
     new 2eea217  AIRAVATA-3276 Migration script for ui config change
2eea217 is described below

commit 2eea2170cb49fe4cec820c56421b91a3eb9e6023
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Fri Jan 10 14:59:40 2020 -0500

    AIRAVATA-3276 Migration script for ui config change
---
 .../next/DeltaScripts/appCatalog_schema_delta.sql     | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/modules/registry/release-migration-scripts/next/DeltaScripts/appCatalog_schema_delta.sql b/modules/registry/release-migration-scripts/next/DeltaScripts/appCatalog_schema_delta.sql
index 839c2e1..b9f4385 100644
--- a/modules/registry/release-migration-scripts/next/DeltaScripts/appCatalog_schema_delta.sql
+++ b/modules/registry/release-migration-scripts/next/DeltaScripts/appCatalog_schema_delta.sql
@@ -19,3 +19,22 @@
 --
 
 use app_catalog;
+
+-- AIRAVATA-3276 Replace JSON configuration: "toggle": ["isRequired"] ->
+-- "isRequired": true. Toggling requiredToAddedToCommandLine no longer needed.
+
+-- replace toggle with is isRequired
+update APPLICATION_INPUT
+set METADATA = REGEXP_REPLACE(METADATA, '"toggle": \\[[^}]+\\]', CONCAT('"isRequired": ', IF(IS_REQUIRED=1, 'true', 'false')))
+-- showOptions has "toggle" but not "isRequired"
+where METADATA rlike '"showOptions": {"toggle": \\[[^}]+\\]'
+  and NOT METADATA rlike '"showOptions": {.*"isRequired": (true|false)'
+;
+
+-- remove toggle since isRequired is already there
+update APPLICATION_INPUT
+set METADATA = REGEXP_REPLACE(METADATA, '(, )?"toggle": \\[[^}]+\\](, )?', '')
+-- showOptions has BOTH "toggle" and "isRequired"
+where METADATA rlike '"showOptions": {"toggle": \\[[^}]+\\]'
+  and METADATA rlike '"showOptions": {.*"isRequired": (true|false)'
+;