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 2020/12/24 15:58:18 UTC

[GitHub] [incubator-superset] zhangsikai123 opened a new issue #12202: superset db upgrade failed when trying to upgrade superset (already on use) from an old build

zhangsikai123 opened a new issue #12202:
URL: https://github.com/apache/incubator-superset/issues/12202


   when I try to upgrade my superset, I use superset db upgrade, I ran into the error:  
   ```
   sqlalchemy.exc.IntegrityError: (pymysql.err.IntegrityError) (1062, "Duplicate entry 'xxxx' for key 'uq_saved_query_uuid'")
   [SQL: ALTER TABLE saved_query ADD CONSTRAINT uq_saved_query_uuid UNIQUE (uuid)]
   (Background on this error at: http://sqlalche.me/e/13/gkpj)
   ```
   ### Environment
   Mysql-5.7.25
   
   ### Additional context
   I went back to commit d7eb1d47:  on 96e99fb176a0_add_import_mixing_to_saved_query.py, there is a line of code, which is obviously written for acceleration:
   ```
   # Add uuids directly using built-in SQL uuid function
   add_uuids_by_dialect = {
       MySQLDialect: """UPDATE %s SET uuid = UNHEX(REPLACE(uuid(), "-", ""));""",
       PGDialect: """UPDATE %s SET uuid = uuid_in(md5(random()::text || clock_timestamp()::text)::cstring);""",
   }
   
   ```
   I tried this line of code on my table with couple rows, it gives exact same uuid for each row. After I deleted this line of code, everything goes on well.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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