2014-12-17 21:22:37 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
import django.utils.timezone
|
|
|
|
import model_utils.fields
|
2018-11-19 23:28:40 +01:00
|
|
|
from django.db import migrations, models
|
2014-12-17 21:22:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
|
|
('domains', '0001_initial'),
|
|
|
|
('osusers', '0001_initial'),
|
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='MailAddress',
|
|
|
|
fields=[
|
2018-11-19 23:28:40 +01:00
|
|
|
('id', models.AutoField(
|
|
|
|
verbose_name='ID', serialize=False, auto_created=True,
|
|
|
|
primary_key=True)),
|
|
|
|
('created', model_utils.fields.AutoCreatedField(
|
|
|
|
default=django.utils.timezone.now, verbose_name='created',
|
|
|
|
editable=False)),
|
|
|
|
('modified', model_utils.fields.AutoLastModifiedField(
|
|
|
|
default=django.utils.timezone.now, verbose_name='modified',
|
|
|
|
editable=False)),
|
2014-12-17 21:22:37 +01:00
|
|
|
('active', models.BooleanField(default=True)),
|
|
|
|
('localpart', models.CharField(max_length=128)),
|
|
|
|
],
|
|
|
|
options={
|
|
|
|
'verbose_name': 'Mail address',
|
|
|
|
'verbose_name_plural': 'Mail addresses',
|
|
|
|
},
|
|
|
|
bases=(models.Model,),
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='MailAddressForward',
|
|
|
|
fields=[
|
2018-11-19 23:28:40 +01:00
|
|
|
('id', models.AutoField(
|
|
|
|
verbose_name='ID', serialize=False, auto_created=True,
|
|
|
|
primary_key=True)),
|
|
|
|
('created', model_utils.fields.AutoCreatedField(
|
|
|
|
default=django.utils.timezone.now, verbose_name='created',
|
|
|
|
editable=False)),
|
|
|
|
('modified', model_utils.fields.AutoLastModifiedField(
|
|
|
|
default=django.utils.timezone.now, verbose_name='modified',
|
|
|
|
editable=False)),
|
2014-12-17 21:22:37 +01:00
|
|
|
('target', models.EmailField(max_length=254)),
|
|
|
|
],
|
|
|
|
options={
|
|
|
|
},
|
|
|
|
bases=(models.Model,),
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='MailAddressMailbox',
|
|
|
|
fields=[
|
2018-11-19 23:28:40 +01:00
|
|
|
('created', model_utils.fields.AutoCreatedField(
|
|
|
|
default=django.utils.timezone.now, verbose_name='created',
|
|
|
|
editable=False)),
|
|
|
|
('modified', model_utils.fields.AutoLastModifiedField(
|
|
|
|
default=django.utils.timezone.now, verbose_name='modified',
|
|
|
|
editable=False)),
|
|
|
|
('mailaddress', models.OneToOneField(
|
|
|
|
primary_key=True, serialize=False,
|
|
|
|
to='managemails.MailAddress', on_delete=models.CASCADE)),
|
2014-12-17 21:22:37 +01:00
|
|
|
],
|
|
|
|
options={
|
|
|
|
},
|
|
|
|
bases=(models.Model,),
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='Mailbox',
|
|
|
|
fields=[
|
2018-11-19 23:28:40 +01:00
|
|
|
('id', models.AutoField(
|
|
|
|
verbose_name='ID', serialize=False, auto_created=True,
|
|
|
|
primary_key=True)),
|
|
|
|
('created', model_utils.fields.AutoCreatedField(
|
|
|
|
default=django.utils.timezone.now, verbose_name='created',
|
|
|
|
editable=False)),
|
|
|
|
('modified', model_utils.fields.AutoLastModifiedField(
|
|
|
|
default=django.utils.timezone.now, verbose_name='modified',
|
|
|
|
editable=False)),
|
2014-12-17 21:22:37 +01:00
|
|
|
('active', models.BooleanField(default=True)),
|
|
|
|
('username', models.CharField(unique=True, max_length=128)),
|
|
|
|
('password', models.CharField(max_length=255)),
|
2018-11-19 23:28:40 +01:00
|
|
|
('osuser', models.ForeignKey(
|
|
|
|
to='osusers.User', on_delete=models.CASCADE)),
|
2014-12-17 21:22:37 +01:00
|
|
|
],
|
|
|
|
options={
|
|
|
|
'verbose_name': 'Mailbox',
|
|
|
|
'verbose_name_plural': 'Mailboxes',
|
|
|
|
},
|
|
|
|
bases=(models.Model,),
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='mailaddressmailbox',
|
|
|
|
name='mailbox',
|
2018-11-19 23:28:40 +01:00
|
|
|
field=models.ForeignKey(
|
|
|
|
to='managemails.Mailbox', on_delete=models.CASCADE),
|
2014-12-17 21:22:37 +01:00
|
|
|
preserve_default=True,
|
|
|
|
),
|
|
|
|
migrations.AlterUniqueTogether(
|
|
|
|
name='mailaddressmailbox',
|
2018-11-19 23:28:40 +01:00
|
|
|
unique_together={('mailaddress', 'mailbox')},
|
2014-12-17 21:22:37 +01:00
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='mailaddressforward',
|
|
|
|
name='mailaddress',
|
2018-11-19 23:28:40 +01:00
|
|
|
field=models.ForeignKey(
|
|
|
|
to='managemails.MailAddress', on_delete=models.CASCADE),
|
2014-12-17 21:22:37 +01:00
|
|
|
preserve_default=True,
|
|
|
|
),
|
|
|
|
migrations.AlterUniqueTogether(
|
|
|
|
name='mailaddressforward',
|
2018-11-19 23:28:40 +01:00
|
|
|
unique_together={('mailaddress', 'target')},
|
2014-12-17 21:22:37 +01:00
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='mailaddress',
|
|
|
|
name='domain',
|
2018-11-19 23:28:40 +01:00
|
|
|
field=models.ForeignKey(
|
|
|
|
to='domains.MailDomain', on_delete=models.CASCADE),
|
2014-12-17 21:22:37 +01:00
|
|
|
preserve_default=True,
|
|
|
|
),
|
|
|
|
migrations.AlterUniqueTogether(
|
|
|
|
name='mailaddress',
|
2018-11-19 23:28:40 +01:00
|
|
|
unique_together={('localpart', 'domain')},
|
2014-12-17 21:22:37 +01:00
|
|
|
),
|
|
|
|
]
|