mirror of
https://github.com/baserow/baserow.git
synced 2026-12-06 09:18:47 +00:00
prevent creating a transaction when updating all tables
This commit is contained in:
1 parent
4ab8b3eeba
commit
5affc3bfa3
1 file changed
+5
@@ -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 = [
|
||||
|
||||
Reference in new issue
Block a user