From cf9a4a3c005cdec7eaa4e9a1ac4fd476d348f6ba Mon Sep 17 00:00:00 2001 From: Marc 'risson' Schmitt Date: Thu, 1 Aug 2024 20:01:41 +0200 Subject: [PATCH] core: add index on enabled field of sources (#10572) * core: add index on enabled field of sources Signed-off-by: Marc 'risson' Schmitt * migrations Signed-off-by: Marc 'risson' Schmitt * re migrations Signed-off-by: Marc 'risson' Schmitt --------- Signed-off-by: Marc 'risson' Schmitt --- ...8_source_authentik_c_enabled_d72365_idx.py | 19 +++++++++++++++++++ authentik/core/models.py | 5 +++++ 2 files changed, 24 insertions(+) create mode 100644 authentik/core/migrations/0038_source_authentik_c_enabled_d72365_idx.py diff --git a/authentik/core/migrations/0038_source_authentik_c_enabled_d72365_idx.py b/authentik/core/migrations/0038_source_authentik_c_enabled_d72365_idx.py new file mode 100644 index 0000000000..ba72ffdee6 --- /dev/null +++ b/authentik/core/migrations/0038_source_authentik_c_enabled_d72365_idx.py @@ -0,0 +1,19 @@ +# Generated by Django 5.0.7 on 2024-07-22 13:32 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("authentik_core", "0037_remove_source_property_mappings"), + ("authentik_flows", "0027_auto_20231028_1424"), + ("authentik_policies", "0011_policybinding_failure_result_and_more"), + ] + + operations = [ + migrations.AddIndex( + model_name="source", + index=models.Index(fields=["enabled"], name="authentik_c_enabled_d72365_idx"), + ), + ] diff --git a/authentik/core/models.py b/authentik/core/models.py index d0a70d6bbf..908bb614b6 100644 --- a/authentik/core/models.py +++ b/authentik/core/models.py @@ -683,6 +683,11 @@ class Source(ManagedModel, SerializerModel, PolicyBindingModel): "name", ] ), + models.Index( + fields=[ + "enabled", + ] + ), ]