Skip to content

Commit acc6bb5

Browse files
authored
PageView: use BigAutoField for primary key (#9670)
How to deploy We create page views on 404 and on page views (duh), so while we do the migration this may slow down doc serving (specially on .com where we have this feature enable for everyone), so in order to avoid that we need to disable page views while we do the migration. Luckily we already have a feature flag for that: https://github.com/readthedocs/readthedocs.org/blob/a09bc1a976a93bcc3f987fa0a052901f0065619f/readthedocs/projects/models.py#L1897-L1900 ref #9492
1 parent 37b8e43 commit acc6bb5

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

readthedocs/analytics/apps.py

+1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ class AnalyticsAppConfig(AppConfig):
77

88
"""Analytics app init code."""
99

10+
default_auto_field = "django.db.models.BigAutoField"
1011
name = 'readthedocs.analytics'
1112
verbose_name = 'Analytics'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Generated by Django 3.2.15 on 2022-10-18 15:25
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("analytics", "0005_add_unique_constraint"),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name="pageview",
15+
name="id",
16+
field=models.BigAutoField(
17+
auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
18+
),
19+
),
20+
]

0 commit comments

Comments
 (0)