eschutho commented on a change in pull request #15807:
URL: https://github.com/apache/superset/pull/15807#discussion_r673571751



##########
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 just looked it up, that looks good. 




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