From f51c367ead07741cbb53ba23ad2375df95eeb42d Mon Sep 17 00:00:00 2001 From: jedi Date: Wed, 13 Nov 2024 23:01:12 +0100 Subject: [PATCH] stash --- .../0006_alter_eventaddress_address.py | 18 ---------- core/mail/migrations/0007_email_raw_file.py | 36 ------------------- 2 files changed, 54 deletions(-) delete mode 100644 core/mail/migrations/0006_alter_eventaddress_address.py delete mode 100644 core/mail/migrations/0007_email_raw_file.py diff --git a/core/mail/migrations/0006_alter_eventaddress_address.py b/core/mail/migrations/0006_alter_eventaddress_address.py deleted file mode 100644 index 5a03261..0000000 --- a/core/mail/migrations/0006_alter_eventaddress_address.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 4.2.7 on 2024-11-06 06:13 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('mail', '0005_alter_eventaddress_event'), - ] - - operations = [ - migrations.AlterField( - model_name='eventaddress', - name='address', - field=models.CharField(max_length=255, unique=True), - ), - ] diff --git a/core/mail/migrations/0007_email_raw_file.py b/core/mail/migrations/0007_email_raw_file.py deleted file mode 100644 index 03d0db0..0000000 --- a/core/mail/migrations/0007_email_raw_file.py +++ /dev/null @@ -1,36 +0,0 @@ -# Generated by Django 4.2.7 on 2024-11-08 20:37 -from django.core.files.base import ContentFile -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('mail', '0006_alter_eventaddress_address'), - ] - - def move_raw_mails_to_file(apps, schema_editor): - Email = apps.get_model('mail', 'Email') - for email in Email.objects.all(): - raw_content = email.raw - email.raw_file = ContentFile(raw_content) - email.raw = None - email.save() - - operations = [ - migrations.AddField( - model_name='email', - name='raw_file', - field=models.FileField(null=True, upload_to='raw_mail/'), - ), - migrations.RunPython(move_raw_mails_to_file), - migrations.RemoveField( - model_name='email', - name='raw', - ), - migrations.AlterField( - model_name='email', - name='raw_file', - field=models.FileField(upload_to='raw_mail/'), - ), - ]