diff --git a/apps/lead/migrations/0050_auto_20240621_1149.py b/apps/lead/migrations/0050_auto_20240621_1149.py index 174b45d6ac..4c710310de 100644 --- a/apps/lead/migrations/0050_auto_20240621_1149.py +++ b/apps/lead/migrations/0050_auto_20240621_1149.py @@ -19,4 +19,10 @@ class Migration(migrations.Migration): old_name='LeadPreviewImage', new_name='LeadPreviewAttachment' ), + + migrations.AddField( + model_name='leadpreviewattachment', + name='file_preview', + field=models.FileField(upload_to='lead-preview/attachments-preview/', null=True) + ), ] diff --git a/apps/lead/migrations/0051_auto_20240625_0509.py b/apps/lead/migrations/0051_auto_20240625_0509.py index cece84578e..372b0494b7 100644 --- a/apps/lead/migrations/0051_auto_20240625_0509.py +++ b/apps/lead/migrations/0051_auto_20240625_0509.py @@ -9,7 +9,7 @@ def set_file_preview(apps, schema_editor): for lead_attachment in lead_attachments: lead_attachment.file_preview = lead_attachment.file lead_attachment.type = 2 # default type is image - lead_attachment.save(updated_fields=['file_preview','type']) + lead_attachment.save() class Migration(migrations.Migration): @@ -29,11 +29,6 @@ class Migration(migrations.Migration): name='page_number', field=models.IntegerField(default=0), ), - migrations.AddField( - model_name='leadpreviewattachment', - name='file_preview', - field=models.FileField(upload_to='lead-preview/attachments-preview/') - ), migrations.AddField( model_name='leadpreviewattachment', name='type', @@ -42,5 +37,10 @@ class Migration(migrations.Migration): migrations.RunPython( set_file_preview, reverse_code=migrations.RunPython.noop, - ) + ), + migrations.AlterField( + model_name='leadpreviewattachment', + name='file_preview', + field=models.FileField(upload_to='lead-preview/attachments-preview/') + ), ] diff --git a/apps/unified_connector/migrations/0010_auto_20240625_0806.py b/apps/unified_connector/migrations/0010_auto_20240625_0806.py index fae4142a9d..d2e57fcb3e 100644 --- a/apps/unified_connector/migrations/0010_auto_20240625_0806.py +++ b/apps/unified_connector/migrations/0010_auto_20240625_0806.py @@ -2,13 +2,14 @@ from django.db import migrations, models + def set_file_preview(apps, schema_editor): ConnectorLeadPreviewAttachment = apps.get_model('unified_connector', 'ConnectorLeadPreviewAttachment') connector_lead_attachments = ConnectorLeadPreviewAttachment.objects.all() for connector_lead_attachment in connector_lead_attachments: connector_lead_attachment.file_preview = connector_lead_attachment.file connector_lead_attachment.type = 2 # default type is image - connector_lead_attachment.save(updated_fields=['file_preview','type']) + connector_lead_attachment.save() class Migration(migrations.Migration):