diff --git a/bootstrap/sql/migrations/native/1.4.0/mysql/postDataMigrationSQLScript.sql b/bootstrap/sql/migrations/native/1.4.0/mysql/postDataMigrationSQLScript.sql index b58b9bb1ffc..b8e589d8aa2 100644 --- a/bootstrap/sql/migrations/native/1.4.0/mysql/postDataMigrationSQLScript.sql +++ b/bootstrap/sql/migrations/native/1.4.0/mysql/postDataMigrationSQLScript.sql @@ -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 \ No newline at end of file diff --git a/bootstrap/sql/migrations/native/1.4.0/postgres/postDataMigrationSQLScript.sql b/bootstrap/sql/migrations/native/1.4.0/postgres/postDataMigrationSQLScript.sql index 5e87a00ace0..1893b3140cd 100644 --- a/bootstrap/sql/migrations/native/1.4.0/postgres/postDataMigrationSQLScript.sql +++ b/bootstrap/sql/migrations/native/1.4.0/postgres/postDataMigrationSQLScript.sql @@ -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'; \ No newline at end of file +) +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 \ No newline at end of file diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/resources/settings/SettingsCache.java b/openmetadata-service/src/main/java/org/openmetadata/service/resources/settings/SettingsCache.java index da2c5bcd0fa..509090b2cd5 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/resources/settings/SettingsCache.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/resources/settings/SettingsCache.java @@ -84,6 +84,7 @@ public class SettingsCache { .withCustomLogoConfig( new LogoConfiguration() .withCustomLogoUrlPath("") + .withCustomFaviconUrlPath("") .withCustomMonogramUrlPath("")) .withCustomTheme( new ThemeConfiguration()