From 9c87212746a48cc2888b4cbea79e4a51c46b067b Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 11 Oct 2024 16:52:25 +0100 Subject: [PATCH] Revert "Don't run migrations" This reverts commit 351f5593d2b2f460dbd04d61d5737fdf0ab81872. This is needed for the admin --- yamdl_playground/core/apps.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/yamdl_playground/core/apps.py b/yamdl_playground/core/apps.py index 39d1672..8200b13 100644 --- a/yamdl_playground/core/apps.py +++ b/yamdl_playground/core/apps.py @@ -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='');")