-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding migration to fix UNLOGGED tables problem.
- Loading branch information
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = [] |