bito-code-review[bot] commented on PR #41126:
URL: https://github.com/apache/superset/pull/41126#issuecomment-4765207966

   <!-- Bito Reply -->
   The flagged issue is correct. Updating the ORM model prevents new foreign 
key constraints from being created, but it does not remove existing constraints 
from databases already initialized with the previous model definition. To 
resolve this, an Alembic migration is required to drop these constraints.
   
   To implement this, create a new migration file (e.g., 
`superset/migrations/versions/2026-06-22_drop_tagged_object_fk.py`) that uses 
`op.drop_constraint` with dialect-specific checks to remove the foreign keys on 
`tagged_object.object_id`.
   
   There are no other comments in the provided review context to address.
   
   **superset/migrations/versions/2026-06-22_drop_tagged_object_fk.py**
   ```
   def upgrade():
       bind = op.get_bind()
       inspector = sa.inspect(bind)
       constraints = [c['name'] for c in 
inspector.get_foreign_keys('tagged_object') if 'object_id' in 
c['constrained_columns']]
       for constraint in constraints:
           op.drop_constraint(constraint, 'tagged_object', type_='foreignkey')
   ```


-- 
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]

Reply via email to