Browse Source

added default debugDuration to the profileData

pull/13021/head
YevhenBondarenko 1 year ago
parent
commit
16ff4e1e97
  1. 10
      application/src/main/data/upgrade/basic/schema_update.sql
  2. 4
      application/src/main/java/org/thingsboard/server/service/install/DefaultSystemDataLoaderService.java
  3. 4
      dao/src/main/java/org/thingsboard/server/dao/tenant/TenantProfileServiceImpl.java

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

@ -83,3 +83,13 @@ SET profile_data = profile_data
WHERE profile_data->'configuration'->>'maxCalculatedFieldsPerEntity' IS NULL;
-- UPDATE TENANT PROFILE CALCULATED FIELD LIMITS END
-- UPDATE TENANT PROFILE DEBUG DURATION START
UPDATE tenant_profile
SET profile_data = jsonb_set(profile_data, '{configuration,maxDebugModeDurationMinutes}', '15', true)
WHERE
profile_data->'configuration' ? 'maxDebugModeDurationMinutes' = false
OR (profile_data->'configuration'->>'maxDebugModeDurationMinutes')::int = 0;
-- UPDATE TENANT PROFILE DEBUG DURATION END

4
application/src/main/java/org/thingsboard/server/service/install/DefaultSystemDataLoaderService.java

@ -199,7 +199,9 @@ public class DefaultSystemDataLoaderService implements SystemDataLoaderService {
tenantProfileService.findOrCreateDefaultTenantProfile(TenantId.SYS_TENANT_ID);
TenantProfileData isolatedRuleEngineTenantProfileData = new TenantProfileData();
isolatedRuleEngineTenantProfileData.setConfiguration(new DefaultTenantProfileConfiguration());
DefaultTenantProfileConfiguration configuration = new DefaultTenantProfileConfiguration();
configuration.setMaxDebugModeDurationMinutes(15);
isolatedRuleEngineTenantProfileData.setConfiguration(configuration);
TenantProfileQueueConfiguration mainQueueConfiguration = new TenantProfileQueueConfiguration();
mainQueueConfiguration.setName(DataConstants.MAIN_QUEUE_NAME);

4
dao/src/main/java/org/thingsboard/server/dao/tenant/TenantProfileServiceImpl.java

@ -160,7 +160,9 @@ public class TenantProfileServiceImpl extends AbstractCachedEntityService<Tenant
defaultTenantProfile.setDefault(true);
defaultTenantProfile.setName("Default");
TenantProfileData profileData = new TenantProfileData();
profileData.setConfiguration(new DefaultTenantProfileConfiguration());
DefaultTenantProfileConfiguration configuration = new DefaultTenantProfileConfiguration();
configuration.setMaxDebugModeDurationMinutes(15);
profileData.setConfiguration(configuration);
defaultTenantProfile.setProfileData(profileData);
defaultTenantProfile.setDescription("Default tenant profile");
defaultTenantProfile.setIsolatedTbRuleEngine(false);

Loading…
Cancel
Save