Try using foreign_key_checks

This commit is contained in:
tcely 2025-05-04 13:35:51 -04:00 committed by GitHub
parent 621a578787
commit 305d27a7af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -181,7 +181,8 @@ class Command(BaseCommand):
deferrable='',
)
schema.execute(remove_fk, None)
schema.execute('SET foreign_key_checks=0', None)
#schema.execute(remove_fk, None)
schema.execute(
schema.sql_alter_column % dict(
table=media_table_str,
@ -212,7 +213,8 @@ class Command(BaseCommand):
),
None,
)
schema.execute(add_fk, None)
#schema.execute(add_fk, None)
schema.execute('SET foreign_key_checks=1', None)
if table_names: