codeant-ai-for-open-source[bot] commented on code in PR #40134: URL: https://github.com/apache/superset/pull/40134#discussion_r3245448869
########## superset/migrations/versions/2026-03-02_00-00_ce6bd21901ab_migrate_deckgl_and_mapbox.py: ########## @@ -44,7 +44,7 @@ # revision identifiers, used by Alembic. revision = "ce6bd21901ab" -down_revision = "a1b2c3d4e5f6" +down_revision = "41292324bf4e" Review Comment: Not quite — Alembic does **not** treat this as “if it’s ahead, do nothing.” It first reads the DB’s current revision from `alembic_version` and then tries to find that exact revision node in the migration graph. So if an environment is stamped with `a1b2c3d4e5f6` and that revision no longer exists in the scripts, Alembic can’t build the path and will fail before it can decide what to upgrade. ### Why this PR’s change is risky Changing: ```python down_revision = "a1b2c3d4e5f6" ``` to: ```python down_revision = "41292324bf4e" ``` fixes the chain for **new** installs, but it breaks **existing** databases that already recorded the old placeholder revision. ### Safer fix Keep a legacy node for `a1b2c3d4e5f6` in the migration history, or add a bridge migration that preserves the old revision ID and points forward to the new one. That way both cases work: - old deployments can still resolve their current revision - fresh deployments follow the corrected chain ### Conclusion So the issue raised in the review is valid: Alembic needs the old revision to remain reachable. If you want, I can help suggest the smallest bridge-migration approach to preserve compatibility without manual stamping. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
