1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-04-10 23:50:12 +00:00

prevent creating a transaction when updating all tables

This commit is contained in:
Bram Wiepjes 2021-03-16 18:15:51 +01:00
parent 4ab8b3eeba
commit 5affc3bfa3

View file

@ -9,6 +9,10 @@ def forward(apps, schema_editor):
connection = connections[settings.USER_TABLE_DATABASE]
with connection.schema_editor() as tables_schema_editor:
# We need to stop the transaction because we might need to lock a lot of tables
# which could result in an out of memory exception.
tables_schema_editor.atomic.__exit__(None, None, None)
for field in DateField.objects.all():
table_name = f'database_table_{field.table.id}'
field_name = f'field_{field.id}'
@ -20,6 +24,7 @@ def forward(apps, schema_editor):
)
class Migration(migrations.Migration):
dependencies = [