2015-01-24 19:10:58 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import django.utils.timezone
|
|
|
|
import model_utils.fields
|
2023-02-18 22:46:48 +01:00
|
|
|
from django.conf import settings
|
|
|
|
from django.db import migrations, models
|
2015-01-24 19:10:58 +01:00
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
2023-02-18 22:46:48 +01:00
|
|
|
("domains", "0001_initial"),
|
2015-01-24 19:10:58 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
2023-02-18 22:46:48 +01:00
|
|
|
name="HostingDomain",
|
2015-01-24 19:10:58 +01:00
|
|
|
fields=[
|
2023-02-18 22:46:48 +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,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"domain",
|
|
|
|
models.CharField(
|
|
|
|
unique=True, max_length=128, verbose_name="domain name"
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"customer",
|
|
|
|
models.ForeignKey(
|
|
|
|
verbose_name="customer",
|
|
|
|
blank=True,
|
|
|
|
to=settings.AUTH_USER_MODEL,
|
|
|
|
null=True,
|
|
|
|
on_delete=models.CASCADE,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"maildomain",
|
|
|
|
models.OneToOneField(
|
|
|
|
null=True,
|
|
|
|
to="domains.MailDomain",
|
|
|
|
blank=True,
|
|
|
|
help_text="assigned mail domain for this domain",
|
|
|
|
verbose_name="mail domain",
|
|
|
|
on_delete=models.CASCADE,
|
|
|
|
),
|
|
|
|
),
|
2015-01-24 19:10:58 +01:00
|
|
|
],
|
|
|
|
options={
|
2023-02-18 22:46:48 +01:00
|
|
|
"verbose_name": "Hosting domain",
|
|
|
|
"verbose_name_plural": "Hosting domains",
|
2015-01-24 19:10:58 +01:00
|
|
|
},
|
|
|
|
bases=(models.Model,),
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
2023-02-18 22:46:48 +01:00
|
|
|
model_name="maildomain",
|
|
|
|
name="customer",
|
2018-11-19 23:28:40 +01:00
|
|
|
field=models.ForeignKey(
|
2023-02-18 22:46:48 +01:00
|
|
|
verbose_name="customer",
|
|
|
|
blank=True,
|
|
|
|
to=settings.AUTH_USER_MODEL,
|
|
|
|
null=True,
|
|
|
|
on_delete=models.CASCADE,
|
|
|
|
),
|
2015-01-24 19:10:58 +01:00
|
|
|
preserve_default=True,
|
|
|
|
),
|
|
|
|
migrations.AlterField(
|
2023-02-18 22:46:48 +01:00
|
|
|
model_name="maildomain",
|
|
|
|
name="domain",
|
2018-11-19 23:28:40 +01:00
|
|
|
field=models.CharField(
|
2023-02-18 22:46:48 +01:00
|
|
|
unique=True, max_length=128, verbose_name="domain name"
|
|
|
|
),
|
2015-01-24 19:10:58 +01:00
|
|
|
preserve_default=True,
|
|
|
|
),
|
|
|
|
]
|