betodealmeida commented on a change in pull request #15807:
URL: https://github.com/apache/superset/pull/15807#discussion_r673567924
##########
File path: superset/migrations/versions/49b5a32daba5_add_report_schedules.py
##########
@@ -119,13 +120,17 @@ def upgrade():
)
+def has_unique_constraint(constraint_name: str, table_name: str) -> bool:
+ bind = op.get_bind()
+ inspector = Inspector.from_engine(bind)
+ unique_constraints = inspector.get_unique_constraints(table_name)
+ return constraint_name in {constraint["name"] for constraint in
unique_constraints}
Review comment:
I wonder if we should move this to `superset/utils/` and use it in all
our new migrations?
--
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]