diff --git a/bootstrap/sql/migrations/native/1.7.1/mysql/schemaChanges.sql b/bootstrap/sql/migrations/native/1.7.1/mysql/schemaChanges.sql new file mode 100644 index 00000000000..ef2088956c2 --- /dev/null +++ b/bootstrap/sql/migrations/native/1.7.1/mysql/schemaChanges.sql @@ -0,0 +1,18 @@ +UPDATE test_definition +SET json = JSON_ARRAY_INSERT( + json, + '$.parameterDefinition[2]', + JSON_OBJECT( + 'name', 'operator', + 'displayName', 'Operator', + 'description', 'Operator to use to compare the result of the custom SQL query to the threshold.', + 'dataType', 'STRING', + 'required', false, + 'optionValues', JSON_ARRAY('==', '>', '>=', '<', '<=', '!=') + ) +) +WHERE NOT JSON_CONTAINS( + JSON_EXTRACT(json, '$.parameterDefinition[*].name'), + JSON_QUOTE('operator') + ) AND name = 'tableCustomSQLQuery'; + diff --git a/bootstrap/sql/migrations/native/1.7.1/postgres/schemaChanges.sql b/bootstrap/sql/migrations/native/1.7.1/postgres/schemaChanges.sql new file mode 100644 index 00000000000..17afa6e77e8 --- /dev/null +++ b/bootstrap/sql/migrations/native/1.7.1/postgres/schemaChanges.sql @@ -0,0 +1,20 @@ +UPDATE test_definition +SET + json = jsonb_insert( + json, + '{parameterDefinition, 2}', + jsonb_build_object( + 'name', 'operator', + 'displayName', 'Operator', + 'description', 'Operator to use to compare the result of the custom SQL query to the threshold.', + 'dataType', 'STRING', + 'required', false, + 'optionValues', jsonb_build_array('==', '>', '>=', '<', '<=', '!=') + ) + ) +WHERE + name = 'tableCustomSQLQuery' + AND NOT jsonb_path_exists( + json, + '$.parameterDefinition[*] ? (@.name == "operator")' + ); \ No newline at end of file