|
| 1 | +<<<<<<<< Updated upstream:src/backend/core/migrations/0006_messagetemplate_alter_maildomain_custom_attributes_and_more.py |
| 2 | +# Generated by Django 5.1.8 on 2025-08-20 06:48 |
| 3 | +======== |
| 4 | +# Generated by Django 5.1.8 on 2025-08-07 09:27 |
| 5 | +>>>>>>>> Stashed changes:src/backend/core/migrations/0005_messagetemplate_alter_maildomain_custom_attributes_and_more.py |
| 6 | + |
| 7 | +import django.db.models.deletion |
| 8 | +import uuid |
| 9 | +from django.db import migrations, models |
| 10 | + |
| 11 | + |
| 12 | +class Migration(migrations.Migration): |
| 13 | + |
| 14 | + dependencies = [ |
| 15 | + ('core', '0005_label_description_label_is_auto_and_more'), |
| 16 | + ] |
| 17 | + |
| 18 | + operations = [ |
| 19 | + migrations.CreateModel( |
| 20 | + name='MessageTemplate', |
| 21 | + fields=[ |
| 22 | + ('id', models.UUIDField(default=uuid.uuid4, editable=False, help_text='primary key for the record as UUID', primary_key=True, serialize=False, verbose_name='id')), |
| 23 | + ('created_at', models.DateTimeField(auto_now_add=True, help_text='date and time at which a record was created', verbose_name='created on')), |
| 24 | + ('updated_at', models.DateTimeField(auto_now=True, help_text='date and time at which a record was last updated', verbose_name='updated on')), |
| 25 | + ('name', models.CharField(help_text="Name of the template (e.g., 'Standard Reply', 'Out of Office', 'Work Signature')", max_length=255, verbose_name='name')), |
| 26 | + ('description', models.TextField(blank=True, help_text='Optional description of when to use this template', verbose_name='description')), |
| 27 | + ('html_body', models.TextField(blank=True, help_text="HTML email body template with placeholders (e.g., '<p>Dear {recipient_name},</p>') or signature content", verbose_name='HTML body')), |
| 28 | + ('text_body', models.TextField(blank=True, help_text="Plain text email body template with placeholders (e.g., 'Dear {recipient_name},') or signature content", verbose_name='text body')), |
| 29 | +<<<<<<<< Updated upstream:src/backend/core/migrations/0006_messagetemplate_alter_maildomain_custom_attributes_and_more.py |
| 30 | + ('kind', models.SmallIntegerField(choices=[(1, 'reply'), (2, 'new_message'), (3, 'signature')], default=1, help_text='Kind of template (reply, forward, new message, auto reply, signature)', verbose_name='kind')), |
| 31 | +======== |
| 32 | + ('kind', models.SmallIntegerField(choices=[(1, 'reply'), (2, 'forward'), (3, 'new_message'), (4, 'auto_reply'), (5, 'signature')], default=1, help_text='Kind of template (reply, forward, new message, auto reply, signature)', verbose_name='kind')), |
| 33 | +>>>>>>>> Stashed changes:src/backend/core/migrations/0005_messagetemplate_alter_maildomain_custom_attributes_and_more.py |
| 34 | + ('is_active', models.BooleanField(default=True, help_text='Whether this template is available for use', verbose_name='is active')), |
| 35 | + ], |
| 36 | + options={ |
| 37 | + 'verbose_name': 'message template', |
| 38 | + 'verbose_name_plural': 'message templates', |
| 39 | + 'db_table': 'messages_messagetemplate', |
| 40 | + 'ordering': ['name'], |
| 41 | + }, |
| 42 | + ), |
| 43 | + migrations.AlterField( |
| 44 | + model_name='maildomain', |
| 45 | + name='custom_attributes', |
| 46 | + field=models.JSONField(blank=True, default=dict, help_text='Metadata to sync to the maildomain group in the identity provider.', verbose_name='Custom attributes'), |
| 47 | + ), |
| 48 | + migrations.AlterField( |
| 49 | + model_name='user', |
| 50 | + name='custom_attributes', |
| 51 | + field=models.JSONField(blank=True, default=dict, help_text='Metadata to sync to the user in the identity provider.', verbose_name='Custom attributes'), |
| 52 | + ), |
| 53 | + migrations.CreateModel( |
| 54 | + name='MessageTemplateMailbox', |
| 55 | + fields=[ |
| 56 | + ('id', models.UUIDField(default=uuid.uuid4, editable=False, help_text='primary key for the record as UUID', primary_key=True, serialize=False, verbose_name='id')), |
| 57 | + ('created_at', models.DateTimeField(auto_now_add=True, help_text='date and time at which a record was created', verbose_name='created on')), |
| 58 | + ('updated_at', models.DateTimeField(auto_now=True, help_text='date and time at which a record was last updated', verbose_name='updated on')), |
| 59 | + ('is_default', models.BooleanField(default=False, help_text='Whether this template is the default for this mailbox', verbose_name='is default')), |
| 60 | + ('mailbox', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='template_mailboxes', to='core.mailbox')), |
| 61 | + ('template', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='template_mailboxes', to='core.messagetemplate')), |
| 62 | + ], |
| 63 | + options={ |
| 64 | + 'verbose_name': 'message template mailbox', |
| 65 | + 'verbose_name_plural': 'message template mailboxes', |
| 66 | + 'db_table': 'messages_messagetemplatemailbox', |
| 67 | + 'unique_together': {('template', 'mailbox')}, |
| 68 | + }, |
| 69 | + ), |
| 70 | + migrations.AddField( |
| 71 | + model_name='messagetemplate', |
| 72 | + name='mailboxes', |
| 73 | + field=models.ManyToManyField(help_text='Mailboxes that can use this template', related_name='message_templates', through='core.MessageTemplateMailbox', to='core.mailbox'), |
| 74 | + ), |
| 75 | + migrations.CreateModel( |
| 76 | + name='MessageTemplateMailDomain', |
| 77 | + fields=[ |
| 78 | + ('id', models.UUIDField(default=uuid.uuid4, editable=False, help_text='primary key for the record as UUID', primary_key=True, serialize=False, verbose_name='id')), |
| 79 | + ('created_at', models.DateTimeField(auto_now_add=True, help_text='date and time at which a record was created', verbose_name='created on')), |
| 80 | + ('updated_at', models.DateTimeField(auto_now=True, help_text='date and time at which a record was last updated', verbose_name='updated on')), |
| 81 | + ('is_default', models.BooleanField(default=False, help_text='Whether this template is the default for this mail domain', verbose_name='is default')), |
| 82 | + ('maildomain', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='template_maildomains', to='core.maildomain')), |
| 83 | + ('template', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='template_maildomains', to='core.messagetemplate')), |
| 84 | + ], |
| 85 | + options={ |
| 86 | + 'verbose_name': 'message template mail domain', |
| 87 | + 'verbose_name_plural': 'message template mail domains', |
| 88 | + 'db_table': 'messages_messagetemplatemaildomain', |
| 89 | + 'unique_together': {('template', 'maildomain')}, |
| 90 | + }, |
| 91 | + ), |
| 92 | + migrations.AddField( |
| 93 | + model_name='messagetemplate', |
| 94 | + name='maildomains', |
| 95 | + field=models.ManyToManyField(help_text='Mail domains that can use this template', related_name='message_templates', through='core.MessageTemplateMailDomain', to='core.maildomain'), |
| 96 | + ), |
| 97 | + ] |
0 commit comments