Skip to content

Commit

Permalink
fix: added the suggestion
Browse files Browse the repository at this point in the history
Co-authored-by: Aakash Singh <mail@singhaakash.dev>
  • Loading branch information
aeswibon and sainak authored Feb 15, 2024
1 parent 3a3e83e commit c9a9b84
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ def forwards_func(apps, schema_editor):
DailyRound.objects.filter(insulin_intake_frequency=0).update(
insulin_intake_frequency=None
)
DailyRound.objects.filter(bp__systolic__lt=0, bp__diastolic__lt=0).update(bp={})
DailyRound.objects.filter(bp__contains={"systolic": {"$lt": 0}}).update(
bp=RawSQL("jsonb_set(bp, '{systolic}', 'null')", [])
)
DailyRound.objects.filter(bp__contains={"diastolic": {"$lt": 0}}).update(
bp=RawSQL("jsonb_set(bp, '{diastolic}', 'null')", [])
)
DailyRound.objects.filter(Q(bp__systolic__lt=0)| Q(bp__diastolic__lt=0)).update(bp={"systolic":None, "diastolic": None})


class Migration(migrations.Migration):
Expand Down

0 comments on commit c9a9b84

Please sign in to comment.