perf: 优化 for tidb

pull/12250/head
ibuler 2023-12-05 16:04:16 +08:00 committed by Bryan
parent 0e7e499a1e
commit ffe3e8a70c
1 changed files with 1 additions and 1 deletions

View File

@ -26,7 +26,7 @@ class OneToOneField(models.OneToOneField, ForeignKey):
def set_db_constraint(): def set_db_constraint():
if os.getenv('DB_CONSTRAINT', '1') != '0': if os.getenv('DB_CONSTRAINT', '1') != '0':
return return
if len(sys.argv) == 2 and sys.argv[1] == 'makemigrations': if len(sys.argv) == 2 and sys.argv[1] in ['makemigrations', 'check']:
return return
print("Set foreignkey db constraint False") print("Set foreignkey db constraint False")
transaction.atomic = atomic transaction.atomic = atomic