You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ma...@apache.org on 2025/07/31 16:59:56 UTC

(superset) 01/01: fix(migrations): prevent theme seeding before themes table exists

This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch theme-check
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 5d9d2dd38f7541c4e58972273ed89eb59981c8c1
Author: Maxime Beauchemin <ma...@gmail.com>
AuthorDate: Thu Jul 31 09:59:39 2025 -0700

    fix(migrations): prevent theme seeding before themes table exists
    
    During database migrations, the theme seeding command attempts to query
    the themes table before it has been created, causing PostgreSQL to throw
    a "relation does not exist" error.
    
    This fix adds a check to ensure the themes table exists before attempting
    to seed system themes, preventing the migration failure while still allowing
    themes to be seeded after the table is created.
    
    Fixes #34403
    
    🤖 Generated with [Claude Code](https://claude.ai/code)
    
    Co-Authored-By: Claude <no...@anthropic.com>
---
 superset/initialization/__init__.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/superset/initialization/__init__.py b/superset/initialization/__init__.py
index ab21add564..83085e7d13 100644
--- a/superset/initialization/__init__.py
+++ b/superset/initialization/__init__.py
@@ -494,7 +494,8 @@ class SupersetAppInitializer:  # pylint: disable=too-many-public-methods
         # Seed system themes from configuration
         from superset.commands.theme.seed import SeedSystemThemesCommand
 
-        SeedSystemThemesCommand().run()
+        if inspector.has_table("themes"):
+            SeedSystemThemesCommand().run()
 
     def init_app_in_ctx(self) -> None:
         """