Files
django-postfix-dovecot-api/dpdapi/migrations/0001_initial.py
T
nikolark b12413ed67 ✨ Modernize bit bit
- bumps
- poetry
- linting
2022-08-07 15:44:40 +02:00

59 lines
2.2 KiB
Python

from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = []
operations = [
migrations.CreateModel(
name="Alias",
fields=[
("id", models.AutoField(verbose_name="ID", serialize=False, auto_created=True, primary_key=True)),
("created", models.DateTimeField(auto_now_add=True)),
("updated", models.DateTimeField(auto_now=True)),
("source", models.EmailField(max_length=254)),
("destination", models.EmailField(max_length=254)),
("active", models.BooleanField(default=True)),
],
options={
"verbose_name_plural": "aliases",
},
bases=(models.Model,),
),
migrations.CreateModel(
name="Domain",
fields=[
("id", models.AutoField(verbose_name="ID", serialize=False, auto_created=True, primary_key=True)),
("created", models.DateTimeField(auto_now_add=True)),
("updated", models.DateTimeField(auto_now=True)),
("name", models.CharField(unique=True, max_length=254)),
],
options={
"abstract": False,
},
bases=(models.Model,),
),
migrations.CreateModel(
name="User",
fields=[
("id", models.AutoField(verbose_name="ID", serialize=False, auto_created=True, primary_key=True)),
("created", models.DateTimeField(auto_now_add=True)),
("updated", models.DateTimeField(auto_now=True)),
("email", models.EmailField(unique=True, max_length=254)),
("password", models.CharField(max_length=109)),
("domain", models.ForeignKey(to="dpdapi.Domain", on_delete=models.CASCADE)),
],
options={
"abstract": False,
},
bases=(models.Model,),
),
migrations.AddField(
model_name="alias",
name="domain",
field=models.ForeignKey(to="dpdapi.Domain", on_delete=models.CASCADE),
preserve_default=True,
),
]