mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-29 11:26:05 +00:00
update SettingsCache and fix migration issues (#16052)
* update SettingsCache and fix migration issues * java checkstyle change
This commit is contained in:
parent
26db024379
commit
c6afcce52d
@ -363,22 +363,26 @@ set json = JSON_INSERT(
|
||||
WHERE name = 'tableRowInsertedCountToBeBetween';
|
||||
-- End of Test Definition Parameter Definition Validation Migration
|
||||
|
||||
-- update existing customLogoConfiguration config with new customUiThemePreference
|
||||
UPDATE openmetadata_settings
|
||||
-- Start of updating existing customLogoConfiguration config with new customUiThemePreference
|
||||
UPDATE openmetadata_settings AS ui
|
||||
JOIN openmetadata_settings AS logo
|
||||
ON ui.configType = 'customUiThemePreference' AND logo.configType = 'customLogoConfiguration'
|
||||
SET
|
||||
configType = 'customUiThemePreference',
|
||||
json = JSON_OBJECT(
|
||||
'customTheme', JSON_OBJECT(
|
||||
'infoColor', '',
|
||||
'errorColor', '',
|
||||
'primaryColor', '',
|
||||
'successColor', '',
|
||||
'warningColor', ''
|
||||
ui.json = JSON_OBJECT(
|
||||
'customLogoConfig', JSON_OBJECT(
|
||||
'customLogoUrlPath', JSON_UNQUOTE(JSON_EXTRACT(logo.json, '$.customLogoUrlPath')),
|
||||
'customFaviconUrlPath', JSON_UNQUOTE(JSON_EXTRACT(logo.json, '$.customFaviconUrlPath')),
|
||||
'customMonogramUrlPath', JSON_UNQUOTE(JSON_EXTRACT(logo.json, '$.customMonogramUrlPath'))
|
||||
),
|
||||
'customLogoConfig', JSON_OBJECT(
|
||||
'customLogoUrlPath', JSON_UNQUOTE(JSON_EXTRACT(json, '$.customLogoUrlPath')),
|
||||
'customFaviconUrlPath', JSON_UNQUOTE(JSON_EXTRACT(json, '$.customFaviconUrlPath')),
|
||||
'customMonogramUrlPath', JSON_UNQUOTE(JSON_EXTRACT(json, '$.customMonogramUrlPath'))
|
||||
'customTheme', JSON_OBJECT(
|
||||
'primaryColor', '',
|
||||
'errorColor', '',
|
||||
'successColor', '',
|
||||
'warningColor', '',
|
||||
'infoColor', ''
|
||||
)
|
||||
)
|
||||
WHERE configType = 'customLogoConfiguration';
|
||||
WHERE ui.configType = 'customUiThemePreference';
|
||||
|
||||
DELETE from openmetadata_settings where configType = 'customLogoConfiguration';
|
||||
-- End of updating customUiThemePreference config
|
@ -363,22 +363,25 @@ SET json = jsonb_set(
|
||||
WHERE name = 'tableRowInsertedCountToBeBetween';
|
||||
-- End of Test Definition Parameter Definition Validation Migration
|
||||
|
||||
-- update existing customLogoConfiguration config with new customUiThemePreference
|
||||
UPDATE openmetadata_settings
|
||||
SET
|
||||
configType = 'customUiThemePreference',
|
||||
json = jsonb_build_object(
|
||||
'customTheme', jsonb_build_object(
|
||||
'infoColor', '',
|
||||
'errorColor', '',
|
||||
'primaryColor', '',
|
||||
'successColor', '',
|
||||
'warningColor', ''
|
||||
),
|
||||
-- Start of updating existing customLogoConfiguration config with new customUiThemePreference
|
||||
UPDATE openmetadata_settings AS ui
|
||||
SET json = jsonb_build_object(
|
||||
'customLogoConfig', jsonb_build_object(
|
||||
'customLogoUrlPath', (json ->> 'customLogoUrlPath'),
|
||||
'customFaviconUrlPath', (json ->> 'customFaviconUrlPath'),
|
||||
'customMonogramUrlPath', (json ->> 'customMonogramUrlPath')
|
||||
'customLogoUrlPath', logo.json -> 'customLogoUrlPath',
|
||||
'customFaviconUrlPath', logo.json -> 'customFaviconUrlPath',
|
||||
'customMonogramUrlPath', logo.json -> 'customMonogramUrlPath'
|
||||
),
|
||||
'customTheme', jsonb_build_object(
|
||||
'primaryColor', '',
|
||||
'errorColor', '',
|
||||
'successColor', '',
|
||||
'warningColor', '',
|
||||
'infoColor', ''
|
||||
)
|
||||
)
|
||||
WHERE configType = 'customLogoConfiguration';
|
||||
)
|
||||
FROM openmetadata_settings AS logo
|
||||
WHERE ui.configType = 'customUiThemePreference'
|
||||
AND logo.configType = 'customLogoConfiguration';
|
||||
|
||||
DELETE from openmetadata_settings where configType = 'customLogoConfiguration';
|
||||
-- End of updating customUiThemePreference config
|
@ -84,6 +84,7 @@ public class SettingsCache {
|
||||
.withCustomLogoConfig(
|
||||
new LogoConfiguration()
|
||||
.withCustomLogoUrlPath("")
|
||||
.withCustomFaviconUrlPath("")
|
||||
.withCustomMonogramUrlPath(""))
|
||||
.withCustomTheme(
|
||||
new ThemeConfiguration()
|
||||
|
Loading…
x
Reference in New Issue
Block a user