Skip to content

Commit

Permalink
Adding migration to fix UNLOGGED tables problem.
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe committed Jun 16, 2021
1 parent 3f8925f commit 965fe35
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion variants/migrations/0069_set_logged_table.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
"""SET small variant table as UNLOGGED to improve insertion performance."""
"""SET small variant table as LOGGED to improve stability."""
from __future__ import unicode_literals

from django.db import migrations
Expand Down
22 changes: 22 additions & 0 deletions variants/migrations/0081_set_logged_table_again.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
"""SET small variant table as LOGGED to improve stability (#2)."""
from __future__ import unicode_literals

from django.db import migrations
from django.conf import settings

if not settings.IS_TESTING:
operations = [migrations.RunSQL("ALTER TABLE variants_smallvariant SET LOGGED;")] + [
migrations.RunSQL("ALTER TABLE variants_smallvariant_%d SET LOGGED" % i)
for i in range(settings.VARFISH_PARTITION_MODULUS_SMALLVARIANT)
]
else:
operations = []


class Migration(migrations.Migration):
atomic = False

dependencies = [("variants", "0080_spanrsubmissionbgjob")]

operations = []

0 comments on commit 965fe35

Please sign in to comment.