You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2018/08/28 01:30:50 UTC

[GitHub] betodealmeida commented on a change in pull request #5729: Silence error on migration 4736ec66ce19 constraint drop

betodealmeida commented on a change in pull request #5729: Silence error on migration 4736ec66ce19 constraint drop
URL: https://github.com/apache/incubator-superset/pull/5729#discussion_r213161898
 
 

 ##########
 File path: superset/migrations/versions/4736ec66ce19_.py
 ##########
 @@ -101,16 +101,24 @@ def upgrade():
 
             batch_op.drop_column('datasource_name')
 
-    # Drop the old more restrictive uniqueness constraint.
-    with op.batch_alter_table('datasources', naming_convention=conv) as batch_op:
-        batch_op.drop_constraint(
-            generic_find_uq_constraint_name(
-                'datasources',
-                {'datasource_name'},
-                insp,
-            ) or 'uq_datasources_datasource_name',
-            type_='unique',
-        )
+    try:
+        # Drop the old more restrictive uniqueness constraint.
+        with op.batch_alter_table('datasources', naming_convention=conv) as batch_op:
+            batch_op.drop_constraint(
+                generic_find_uq_constraint_name(
+                    'datasources',
+                    {'datasource_name'},
+                    insp,
+                ) or 'uq_datasources_datasource_name',
+                type_='unique',
+            )
+    except Exception as e:
+        logging.warning(
+            "Constraint drop failed, you may want to do this "
+            "manually on your database. For context, this is a known "
+            "issue around undeterministic contraint names on Postgres "
 
 Review comment:
   constraint*

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org