1
Fork 0

Revert "Don't run migrations"

This reverts commit 351f5593d2.

This is needed for the admin
This commit is contained in:
Jake Howard 2024-10-11 16:52:25 +01:00
parent d38d2ecb1c
commit 9c87212746
Signed by: jake
GPG key ID: 57AFB45680EDD477

View file

@ -3,6 +3,7 @@ from django.db import connections
from django.db.models.signals import post_save
import warnings
from django.utils.html import strip_tags
from django.core.management import call_command
class CoreConfig(AppConfig):
@ -20,6 +21,9 @@ class CoreConfig(AppConfig):
# Django doesn't like running DB queries during app initialization
warnings.filterwarnings("ignore", module="django.db", category=RuntimeWarning)
# Run migrations, if there are any
call_command("migrate", verbosity=0, no_input=True)
with connection.cursor() as cursor:
cursor.execute("CREATE VIRTUAL TABLE search_index USING fts5(body, content='');")