Browse Source

Improvements to tenant profile upgrade script

pull/14414/head
dshvaika 10 months ago
parent
commit
fa50bda8b7
  1. 69
      application/src/main/data/upgrade/basic/schema_update.sql

69
application/src/main/data/upgrade/basic/schema_update.sql

@ -18,56 +18,27 @@
UPDATE tenant_profile UPDATE tenant_profile
SET profile_data = jsonb_set( SET profile_data = jsonb_set(
profile_data, profile_data,
'{configuration}', '{configuration}',
(profile_data -> 'configuration') jsonb_build_object(
|| jsonb_strip_nulls( 'minAllowedScheduledUpdateIntervalInSecForCF', 60,
jsonb_build_object( 'maxRelationLevelPerCfArgument', 10,
'minAllowedScheduledUpdateIntervalInSecForCF', 'maxRelatedEntitiesToReturnPerCfArgument', 100,
CASE 'minAllowedDeduplicationIntervalInSecForCF', 60,
WHEN (profile_data -> 'configuration') ? 'minAllowedScheduledUpdateIntervalInSecForCF' 'minAllowedAggregationIntervalInSecForCF', 60
THEN NULL )
ELSE to_jsonb(60) ||
END, jsonb_strip_nulls(profile_data -> 'configuration')
'maxRelationLevelPerCfArgument', )
CASE
WHEN (profile_data -> 'configuration') ? 'maxRelationLevelPerCfArgument'
THEN NULL
ELSE to_jsonb(10)
END,
'maxRelatedEntitiesToReturnPerCfArgument',
CASE
WHEN (profile_data -> 'configuration') ? 'maxRelatedEntitiesToReturnPerCfArgument'
THEN NULL
ELSE to_jsonb(100)
END,
'minAllowedDeduplicationIntervalInSecForCF',
CASE
WHEN (profile_data -> 'configuration') ? 'minAllowedDeduplicationIntervalInSecForCF'
THEN NULL
ELSE to_jsonb(60)
END,
'minAllowedAggregationIntervalInSecForCF',
CASE
WHEN (profile_data -> 'configuration') ? 'minAllowedAggregationIntervalInSecForCF'
THEN NULL
ELSE to_jsonb(60)
END
)
),
false
)
WHERE NOT ( WHERE NOT (
(profile_data -> 'configuration') ? 'minAllowedScheduledUpdateIntervalInSecForCF' jsonb_strip_nulls(profile_data -> 'configuration') ?& ARRAY[
AND 'minAllowedScheduledUpdateIntervalInSecForCF',
(profile_data -> 'configuration') ? 'maxRelationLevelPerCfArgument' 'maxRelationLevelPerCfArgument',
AND 'maxRelatedEntitiesToReturnPerCfArgument',
(profile_data -> 'configuration') ? 'maxRelatedEntitiesToReturnPerCfArgument' 'minAllowedDeduplicationIntervalInSecForCF',
AND 'minAllowedAggregationIntervalInSecForCF'
(profile_data -> 'configuration') ? 'minAllowedDeduplicationIntervalInSecForCF' ]
AND );
(profile_data -> 'configuration') ? 'minAllowedAggregationIntervalInSecForCF'
);
-- UPDATE TENANT PROFILE CONFIGURATION END -- UPDATE TENANT PROFILE CONFIGURATION END

Loading…
Cancel
Save