|
| 1 | +# Generated by Django 5.1.8 on 2025-08-20 06:48 |
| 2 | + |
| 3 | +import django.db.models.deletion |
| 4 | +import uuid |
| 5 | +from django.db import migrations, models |
| 6 | + |
| 7 | + |
| 8 | +class Migration(migrations.Migration): |
| 9 | + |
| 10 | + dependencies = [ |
| 11 | + ('core', '0004_alter_maildomain_custom_attributes_and_more'), |
| 12 | + ] |
| 13 | + |
| 14 | + operations = [ |
| 15 | + migrations.CreateModel( |
| 16 | + name='MessageTemplate', |
| 17 | + fields=[ |
| 18 | + ('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')), |
| 19 | + ('created_at', models.DateTimeField(auto_now_add=True, help_text='date and time at which a record was created', verbose_name='created on')), |
| 20 | + ('updated_at', models.DateTimeField(auto_now=True, help_text='date and time at which a record was last updated', verbose_name='updated on')), |
| 21 | + ('name', models.CharField(help_text="Name of the template (e.g., 'Standard Reply', 'Out of Office', 'Work Signature')", max_length=255, verbose_name='name')), |
| 22 | + ('description', models.TextField(blank=True, help_text='Optional description of when to use this template', verbose_name='description')), |
| 23 | + ('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')), |
| 24 | + ('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')), |
| 25 | + ('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')), |
| 26 | + ('is_active', models.BooleanField(default=True, help_text='Whether this template is available for use', verbose_name='is active')), |
| 27 | + ], |
| 28 | + options={ |
| 29 | + 'verbose_name': 'message template', |
| 30 | + 'verbose_name_plural': 'message templates', |
| 31 | + 'db_table': 'messages_messagetemplate', |
| 32 | + 'ordering': ['name'], |
| 33 | + }, |
| 34 | + ), |
| 35 | + migrations.AlterField( |
| 36 | + model_name='maildomain', |
| 37 | + name='custom_attributes', |
| 38 | + field=models.JSONField(blank=True, default=dict, help_text='Metadata to sync to the maildomain group in the identity provider.', verbose_name='Custom attributes'), |
| 39 | + ), |
| 40 | + migrations.AlterField( |
| 41 | + model_name='user', |
| 42 | + name='custom_attributes', |
| 43 | + field=models.JSONField(blank=True, default=dict, help_text='Metadata to sync to the user in the identity provider.', verbose_name='Custom attributes'), |
| 44 | + ), |
| 45 | + migrations.CreateModel( |
| 46 | + name='MessageTemplateMailbox', |
| 47 | + fields=[ |
| 48 | + ('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')), |
| 49 | + ('created_at', models.DateTimeField(auto_now_add=True, help_text='date and time at which a record was created', verbose_name='created on')), |
| 50 | + ('updated_at', models.DateTimeField(auto_now=True, help_text='date and time at which a record was last updated', verbose_name='updated on')), |
| 51 | + ('is_default', models.BooleanField(default=False, help_text='Whether this template is the default for this mailbox', verbose_name='is default')), |
| 52 | + ('mailbox', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='template_mailboxes', to='core.mailbox')), |
| 53 | + ('template', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='template_mailboxes', to='core.messagetemplate')), |
| 54 | + ], |
| 55 | + options={ |
| 56 | + 'verbose_name': 'message template mailbox', |
| 57 | + 'verbose_name_plural': 'message template mailboxes', |
| 58 | + 'db_table': 'messages_messagetemplatemailbox', |
| 59 | + 'unique_together': {('template', 'mailbox')}, |
| 60 | + }, |
| 61 | + ), |
| 62 | + migrations.AddField( |
| 63 | + model_name='messagetemplate', |
| 64 | + name='mailboxes', |
| 65 | + field=models.ManyToManyField(help_text='Mailboxes that can use this template', related_name='message_templates', through='core.MessageTemplateMailbox', to='core.mailbox'), |
| 66 | + ), |
| 67 | + migrations.CreateModel( |
| 68 | + name='MessageTemplateMailDomain', |
| 69 | + fields=[ |
| 70 | + ('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')), |
| 71 | + ('created_at', models.DateTimeField(auto_now_add=True, help_text='date and time at which a record was created', verbose_name='created on')), |
| 72 | + ('updated_at', models.DateTimeField(auto_now=True, help_text='date and time at which a record was last updated', verbose_name='updated on')), |
| 73 | + ('is_default', models.BooleanField(default=False, help_text='Whether this template is the default for this mail domain', verbose_name='is default')), |
| 74 | + ('maildomain', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='template_maildomains', to='core.maildomain')), |
| 75 | + ('template', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='template_maildomains', to='core.messagetemplate')), |
| 76 | + ], |
| 77 | + options={ |
| 78 | + 'verbose_name': 'message template mail domain', |
| 79 | + 'verbose_name_plural': 'message template mail domains', |
| 80 | + 'db_table': 'messages_messagetemplatemaildomain', |
| 81 | + 'unique_together': {('template', 'maildomain')}, |
| 82 | + }, |
| 83 | + ), |
| 84 | + migrations.AddField( |
| 85 | + model_name='messagetemplate', |
| 86 | + name='maildomains', |
| 87 | + field=models.ManyToManyField(help_text='Mail domains that can use this template', related_name='message_templates', through='core.MessageTemplateMailDomain', to='core.maildomain'), |
| 88 | + ), |
| 89 | + ] |
0 commit comments