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:
parent
4ab8b3eeba
commit
5affc3bfa3
1 changed files with 5 additions and 0 deletions
|
@ -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 = [
|
||||
|
|
Loading…
Add table
Reference in a new issue