squalou edited a comment on issue #9727:
URL: 
https://github.com/apache/incubator-superset/issues/9727#issuecomment-624058918


   DAMN !
   using production 0.34.0 dump of 'superset' schema,
   running 'superset db upgrade'
   I now have nelow error.
   
   I'm a supposed to upgrade to 0.35 first ?
   
   ```
   MySQLdb._exceptions.IntegrityError: (1215, 'Cannot add foreign key 
constraint')
   
   The above exception was the direct cause of the following exception:
   
   Traceback (most recent call last):
   
   <long python stack here>
   
   
   sqlalchemy.exc.IntegrityError: (MySQLdb._exceptions.IntegrityError) (1215, 
'Cannot add foreign key constraint')
   [SQL: 
   CREATE TABLE tab_state (
        created_on DATETIME, 
        changed_on DATETIME, 
        extra_json TEXT, 
        id INTEGER NOT NULL AUTO_INCREMENT, 
        user_id INTEGER, 
        label VARCHAR(256), 
        active BOOL, 
        database_id INTEGER, 
        `schema` VARCHAR(256), 
        `sql` TEXT, 
        query_limit INTEGER, 
        latest_query_id VARCHAR(11), 
        autorun BOOL NOT NULL, 
        template_params TEXT, 
        created_by_fk INTEGER, 
        changed_by_fk INTEGER, 
        PRIMARY KEY (id), 
        FOREIGN KEY(changed_by_fk) REFERENCES ab_user (id), 
        FOREIGN KEY(created_by_fk) REFERENCES ab_user (id), 
        FOREIGN KEY(database_id) REFERENCES dbs (id), 
        FOREIGN KEY(latest_query_id) REFERENCES query (client_id), 
        FOREIGN KEY(user_id) REFERENCES ab_user (id), 
        CHECK (active IN (0, 1)), 
        CHECK (autorun IN (0, 1))
   )
   
   ```
   
   manual tests showed that problematic FK is 
   
   ```FOREIGN KEY(latest_query_id) REFERENCES query (client_id)```
   
   running on mysql 5.6
   
   no idea why it fails


----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to