Skip to content

Commit

Permalink
fix: migrations for log class
Browse files Browse the repository at this point in the history
  • Loading branch information
francesco-filicetti committed Dec 2, 2024
1 parent 01c4222 commit 689b9a2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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')},
# ),
]
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
# ),
]
2 changes: 1 addition & 1 deletion uniticket/uni_ticket/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])]')\
Expand Down

0 comments on commit 689b9a2

Please sign in to comment.