From 689b9a2d56b2e5f689c08090170611649e3b2898 Mon Sep 17 00:00:00 2001 From: Francesco Filicetti Date: Mon, 2 Dec 2024 13:24:11 +0100 Subject: [PATCH] fix: migrations for log class --- ...move_log_uni_ticket__content_dbfb39_idx_and_more.py | 8 ++++---- ...nt_type_object_id_uni_ticket__content_dbfb39_idx.py | 10 +++++----- uniticket/uni_ticket/models.py | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/uniticket/uni_ticket/migrations/0016_remove_log_uni_ticket__content_dbfb39_idx_and_more.py b/uniticket/uni_ticket/migrations/0016_remove_log_uni_ticket__content_dbfb39_idx_and_more.py index 6befbc8e..29c20064 100644 --- a/uniticket/uni_ticket/migrations/0016_remove_log_uni_ticket__content_dbfb39_idx_and_more.py +++ b/uniticket/uni_ticket/migrations/0016_remove_log_uni_ticket__content_dbfb39_idx_and_more.py @@ -25,8 +25,8 @@ class Migration(migrations.Migration): name='protocollo_uo', field=models.CharField(choices=[('', '-')], max_length=12, verbose_name='UO'), ), - migrations.AlterIndexTogether( - name='log', - index_together={('content_type', 'object_id')}, - ), + # migrations.AlterIndexTogether( + # name='log', + # index_together={('content_type', 'object_id')}, + # ), ] diff --git a/uniticket/uni_ticket/migrations/0018_rename_log_content_type_object_id_uni_ticket__content_dbfb39_idx.py b/uniticket/uni_ticket/migrations/0018_rename_log_content_type_object_id_uni_ticket__content_dbfb39_idx.py index 6b58b6ad..f120aa7f 100644 --- a/uniticket/uni_ticket/migrations/0018_rename_log_content_type_object_id_uni_ticket__content_dbfb39_idx.py +++ b/uniticket/uni_ticket/migrations/0018_rename_log_content_type_object_id_uni_ticket__content_dbfb39_idx.py @@ -10,9 +10,9 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RenameIndex( - model_name='log', - new_name='uni_ticket__content_dbfb39_idx', - old_fields=('content_type', 'object_id'), - ), + # migrations.RenameIndex( + # model_name='log', + # new_name='uni_ticket__content_dbfb39_idx', + # old_fields=('content_type', 'object_id'), + # ), ] diff --git a/uniticket/uni_ticket/models.py b/uniticket/uni_ticket/models.py index a82c2665..f4fffd23 100644 --- a/uniticket/uni_ticket/models.py +++ b/uniticket/uni_ticket/models.py @@ -77,7 +77,7 @@ def _attachment_upload(instance, filename): ### Custom Logs ### # like django.contrib.admin.models.LogEntry # but object_id as PositiveIntegerField -# and with index_together = ["content_type", "object_id"]) +# and with indexes = [models.Index(fields=["content_type", "object_id"])] import inspect exec(inspect.getsource(LogEntry).replace('db_table = "django_admin_log"', 'indexes = [models.Index(fields=["content_type", "object_id"])]')\