Skip to content

Commit 27d956a

Browse files
authored
SearchQuery: use BigAutoField for primary key (#9671)
* SearchQuery: use BigAutoField for primary key We have 5M records, so migration shouldn't take that long (1-2 min?), and we use a task to create the records, so this shouldn't affect search. ```python In [1]: SearchQuery.objects.count() Out[1]: 5062590 ``` Ref #9492 * Linter
1 parent 7bc5c76 commit 27d956a

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

readthedocs/search/apps.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33

44
class SearchConfig(AppConfig):
5+
default_auto_field = "django.db.models.BigAutoField"
56
name = 'readthedocs.search'
67

78
def ready(self):
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Generated by Django 3.2.15 on 2022-10-18 15:43
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
dependencies = [
8+
("search", "0004_make_total_results_not_null"),
9+
]
10+
11+
operations = [
12+
migrations.AlterField(
13+
model_name="searchquery",
14+
name="id",
15+
field=models.BigAutoField(
16+
auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
17+
),
18+
),
19+
]

0 commit comments

Comments
 (0)