Skip to content

Commit 8bab14c

Browse files
committed
Separate bounce migration into two
1 parent fe8e766 commit 8bab14c

File tree

3 files changed

+23
-12
lines changed

3 files changed

+23
-12
lines changed
Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
# Generated by Django 3.1.7 on 2021-03-28 21:38
22

3-
from django.db.models.expressions import F
4-
from ..models import Session, Hit
53
from django.db import migrations, models
6-
from django.db.models import Subquery, OuterRef
7-
8-
9-
def update_bounce_stats(_a, _b):
10-
Session.objects.all().annotate(hit_count=models.Count("hit")).filter(
11-
hit_count__gt=1
12-
).update(is_bounce=False)
134

145

156
class Migration(migrations.Migration):
@@ -23,6 +14,5 @@ class Migration(migrations.Migration):
2314
model_name="session",
2415
name="is_bounce",
2516
field=models.BooleanField(db_index=True, default=True),
26-
),
27-
migrations.RunPython(update_bounce_stats, lambda: ()),
17+
)
2818
]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Generated by Django 3.1.7 on 2021-03-29 15:00
2+
3+
from django.db import migrations, models
4+
from ..models import Session
5+
6+
7+
def update_bounce_stats(_a, _b):
8+
Session.objects.all().annotate(hit_count=models.Count("hit")).filter(
9+
hit_count__gt=1
10+
).update(is_bounce=False)
11+
12+
13+
class Migration(migrations.Migration):
14+
15+
dependencies = [
16+
("analytics", "0008_session_is_bounce"),
17+
]
18+
19+
operations = [
20+
migrations.RunPython(update_bounce_stats, lambda: ()),
21+
]

shynet/shynet/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from django.contrib.messages import constants as messages
1919

2020
# Increment on new releases
21-
VERSION = "v0.8.1"
21+
VERSION = "v0.8.2alpha"
2222

2323
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
2424
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

0 commit comments

Comments
 (0)