Comment 2 for bug 1741726

Revision history for this message
Kushal Agrawal (kushal2605) wrote :

yes, I think I missed an important part of it. as it does not have any issue with sqllite. But there are issue with mysql database.

The issue is when we created database tables using alembic script we created foreign key using below command:

sa.Column('artifact_id', sa.String(36),
                  sa.ForeignKey('glare_artifacts.id'), nullable=False),

while creating we missed to provide parameter "ondelete='CASCADE'". without it in mysql it becomes as ondelete='RESTRICT' which is default value of it.

Now to drop and recreate the foreign key constraint we found that the name of the foreign-key-constraint is required which is getting decided by the database itself i.e. we do not have control over it. so right now we are not able to drop the constraint because of it. can you please suggest any way to do it?