diff --git a/shynet/analytics/migrations/0008_session_is_bounce.py b/shynet/analytics/migrations/0008_session_is_bounce.py index 0e69eea..c5dfff0 100644 --- a/shynet/analytics/migrations/0008_session_is_bounce.py +++ b/shynet/analytics/migrations/0008_session_is_bounce.py @@ -1,15 +1,6 @@ # Generated by Django 3.1.7 on 2021-03-28 21:38 -from django.db.models.expressions import F -from ..models import Session, Hit from django.db import migrations, models -from django.db.models import Subquery, OuterRef - - -def update_bounce_stats(_a, _b): - Session.objects.all().annotate(hit_count=models.Count("hit")).filter( - hit_count__gt=1 - ).update(is_bounce=False) class Migration(migrations.Migration): @@ -23,6 +14,5 @@ class Migration(migrations.Migration): model_name="session", name="is_bounce", field=models.BooleanField(db_index=True, default=True), - ), - migrations.RunPython(update_bounce_stats, lambda: ()), + ) ] diff --git a/shynet/analytics/migrations/0009_auto_20210329_1100.py b/shynet/analytics/migrations/0009_auto_20210329_1100.py new file mode 100644 index 0000000..fb7ae13 --- /dev/null +++ b/shynet/analytics/migrations/0009_auto_20210329_1100.py @@ -0,0 +1,21 @@ +# Generated by Django 3.1.7 on 2021-03-29 15:00 + +from django.db import migrations, models +from ..models import Session + + +def update_bounce_stats(_a, _b): + Session.objects.all().annotate(hit_count=models.Count("hit")).filter( + hit_count__gt=1 + ).update(is_bounce=False) + + +class Migration(migrations.Migration): + + dependencies = [ + ("analytics", "0008_session_is_bounce"), + ] + + operations = [ + migrations.RunPython(update_bounce_stats, lambda: ()), + ] diff --git a/shynet/shynet/settings.py b/shynet/shynet/settings.py index c7086bc..4f9be36 100644 --- a/shynet/shynet/settings.py +++ b/shynet/shynet/settings.py @@ -18,7 +18,7 @@ import urllib.parse as urlparse from django.contrib.messages import constants as messages # Increment on new releases -VERSION = "v0.8.1" +VERSION = "v0.8.2alpha" # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))