2015-11-05 21:54:21 +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-11-05 21:54:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
2023-02-18 22:46:48 +01:00
|
|
|
("domains", "0002_auto_20150124_1909"),
|
2015-11-05 21:54:21 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
2023-02-18 22:46:48 +01:00
|
|
|
name="DNSComment",
|
2015-11-05 21:54:21 +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,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("name", models.CharField(max_length=255)),
|
|
|
|
("commenttype", models.CharField(max_length=10, db_column="type")),
|
|
|
|
("modified_at", models.IntegerField()),
|
|
|
|
("comment", models.CharField(max_length=65535)),
|
|
|
|
(
|
|
|
|
"customer",
|
|
|
|
models.ForeignKey(
|
|
|
|
verbose_name="customer",
|
|
|
|
to=settings.AUTH_USER_MODEL,
|
|
|
|
on_delete=models.CASCADE,
|
|
|
|
),
|
|
|
|
),
|
2015-11-05 21:54:21 +01:00
|
|
|
],
|
|
|
|
),
|
|
|
|
migrations.RunSQL(
|
2023-02-18 22:46:48 +01:00
|
|
|
"""ALTER TABLE domains_dnscomment ADD CONSTRAINT c_lowercase_name
|
|
|
|
CHECK (((name)::TEXT = LOWER((name)::TEXT)))"""
|
2015-11-05 21:54:21 +01:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2023-02-18 22:46:48 +01:00
|
|
|
name="DNSCryptoKey",
|
2015-11-05 21:54:21 +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,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("flags", models.IntegerField()),
|
|
|
|
("active", models.BooleanField(default=True)),
|
|
|
|
("content", models.TextField()),
|
2015-11-05 21:54:21 +01:00
|
|
|
],
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2023-02-18 22:46:48 +01:00
|
|
|
name="DNSDomain",
|
2015-11-05 21:54:21 +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=255, verbose_name="domain name"
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("master", models.CharField(max_length=128, null=True, blank=True)),
|
|
|
|
("last_check", models.IntegerField(null=True)),
|
|
|
|
(
|
|
|
|
"domaintype",
|
|
|
|
models.CharField(
|
|
|
|
max_length=6,
|
|
|
|
db_column="type",
|
|
|
|
choices=[
|
|
|
|
("MASTER", "Master"),
|
|
|
|
("SLAVE", "Slave"),
|
|
|
|
("NATIVE", "Native"),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("notified_serial", models.IntegerField(null=True)),
|
|
|
|
(
|
|
|
|
"customer",
|
|
|
|
models.ForeignKey(
|
|
|
|
verbose_name="customer",
|
|
|
|
blank=True,
|
|
|
|
to=settings.AUTH_USER_MODEL,
|
|
|
|
null=True,
|
|
|
|
on_delete=models.CASCADE,
|
|
|
|
),
|
|
|
|
),
|
2015-11-05 21:54:21 +01:00
|
|
|
],
|
|
|
|
options={
|
2023-02-18 22:46:48 +01:00
|
|
|
"verbose_name": "DNS domain",
|
|
|
|
"verbose_name_plural": "DNS domains",
|
2015-11-05 21:54:21 +01:00
|
|
|
},
|
|
|
|
),
|
|
|
|
migrations.RunSQL(
|
2023-02-18 22:46:48 +01:00
|
|
|
"""ALTER TABLE domains_dnsdomain ADD CONSTRAINT c_lowercase_name
|
|
|
|
CHECK (((domain)::TEXT = LOWER((domain)::TEXT)))"""
|
2015-11-05 21:54:21 +01:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2023-02-18 22:46:48 +01:00
|
|
|
name="DNSDomainMetadata",
|
2015-11-05 21:54:21 +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,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("kind", models.CharField(max_length=32)),
|
|
|
|
("content", models.TextField()),
|
|
|
|
(
|
|
|
|
"domain",
|
|
|
|
models.ForeignKey(to="domains.DNSDomain", on_delete=models.CASCADE),
|
|
|
|
),
|
2015-11-05 21:54:21 +01:00
|
|
|
],
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2023-02-18 22:46:48 +01:00
|
|
|
name="DNSRecord",
|
2015-11-05 21:54:21 +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,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"name",
|
|
|
|
models.CharField(
|
|
|
|
db_index=True, max_length=255, null=True, blank=True
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"recordtype",
|
|
|
|
models.CharField(
|
|
|
|
max_length=10, null=True, db_column="type", blank=True
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("content", models.CharField(max_length=65535, null=True, blank=True)),
|
|
|
|
("ttl", models.IntegerField(null=True)),
|
|
|
|
("prio", models.IntegerField(null=True)),
|
|
|
|
("change_date", models.IntegerField(null=True)),
|
|
|
|
("disabled", models.BooleanField(default=False)),
|
|
|
|
("ordername", models.CharField(max_length=255)),
|
|
|
|
("auth", models.BooleanField(default=True)),
|
|
|
|
(
|
|
|
|
"domain",
|
|
|
|
models.ForeignKey(to="domains.DNSDomain", on_delete=models.CASCADE),
|
|
|
|
),
|
2015-11-05 21:54:21 +01:00
|
|
|
],
|
|
|
|
options={
|
2023-02-18 22:46:48 +01:00
|
|
|
"verbose_name": "DNS record",
|
|
|
|
"verbose_name_plural": "DNS records",
|
2015-11-05 21:54:21 +01:00
|
|
|
},
|
|
|
|
),
|
|
|
|
migrations.RunSQL(
|
2023-02-18 22:46:48 +01:00
|
|
|
"""ALTER TABLE domains_dnsrecord ADD CONSTRAINT c_lowercase_name
|
|
|
|
CHECK (((name)::TEXT = LOWER((name)::TEXT)))"""
|
2015-11-05 21:54:21 +01:00
|
|
|
),
|
|
|
|
migrations.RunSQL(
|
2023-02-18 22:46:48 +01:00
|
|
|
"""CREATE INDEX recordorder ON domains_dnsrecord (domain_id,
|
|
|
|
ordername text_pattern_ops)"""
|
2015-11-05 21:54:21 +01:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2023-02-18 22:46:48 +01:00
|
|
|
name="DNSSupermaster",
|
2015-11-05 21:54:21 +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,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("ip", models.GenericIPAddressField()),
|
|
|
|
("nameserver", models.CharField(max_length=255)),
|
|
|
|
(
|
|
|
|
"customer",
|
|
|
|
models.ForeignKey(
|
|
|
|
verbose_name="customer",
|
|
|
|
to=settings.AUTH_USER_MODEL,
|
|
|
|
on_delete=models.CASCADE,
|
|
|
|
),
|
|
|
|
),
|
2015-11-05 21:54:21 +01:00
|
|
|
],
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2023-02-18 22:46:48 +01:00
|
|
|
name="DNSTSIGKey",
|
2015-11-05 21:54:21 +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,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("name", models.CharField(max_length=255)),
|
|
|
|
("algorithm", models.CharField(max_length=50)),
|
|
|
|
("secret", models.CharField(max_length=255)),
|
2015-11-05 21:54:21 +01:00
|
|
|
],
|
|
|
|
),
|
|
|
|
migrations.RunSQL(
|
2023-02-18 22:46:48 +01:00
|
|
|
"""ALTER TABLE domains_dnstsigkey ADD CONSTRAINT c_lowercase_name
|
|
|
|
CHECK (((name)::TEXT = LOWER((name)::TEXT)))"""
|
2015-11-05 21:54:21 +01:00
|
|
|
),
|
|
|
|
migrations.AlterField(
|
2023-02-18 22:46:48 +01:00
|
|
|
model_name="hostingdomain",
|
|
|
|
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=255, verbose_name="domain name"
|
|
|
|
),
|
2015-11-05 21:54:21 +01:00
|
|
|
),
|
|
|
|
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=255, verbose_name="domain name"
|
|
|
|
),
|
2015-11-05 21:54:21 +01:00
|
|
|
),
|
|
|
|
migrations.AddField(
|
2023-02-18 22:46:48 +01:00
|
|
|
model_name="dnscryptokey",
|
|
|
|
name="domain",
|
|
|
|
field=models.ForeignKey(to="domains.DNSDomain", on_delete=models.CASCADE),
|
2015-11-05 21:54:21 +01:00
|
|
|
),
|
|
|
|
migrations.AddField(
|
2023-02-18 22:46:48 +01:00
|
|
|
model_name="dnscomment",
|
|
|
|
name="domain",
|
|
|
|
field=models.ForeignKey(to="domains.DNSDomain", on_delete=models.CASCADE),
|
2015-11-05 21:54:21 +01:00
|
|
|
),
|
|
|
|
migrations.AlterUniqueTogether(
|
2023-02-18 22:46:48 +01:00
|
|
|
name="dnssupermaster",
|
|
|
|
unique_together=set([("ip", "nameserver")]),
|
2015-11-05 21:54:21 +01:00
|
|
|
),
|
|
|
|
migrations.AlterUniqueTogether(
|
2023-02-18 22:46:48 +01:00
|
|
|
name="dnstsigkey",
|
|
|
|
unique_together=set([("name", "algorithm")]),
|
2015-11-05 21:54:21 +01:00
|
|
|
),
|
|
|
|
migrations.AlterIndexTogether(
|
2023-02-18 22:46:48 +01:00
|
|
|
name="dnsrecord",
|
|
|
|
index_together=set([("name", "recordtype")]),
|
2015-11-05 21:54:21 +01:00
|
|
|
),
|
|
|
|
migrations.AlterIndexTogether(
|
2023-02-18 22:46:48 +01:00
|
|
|
name="dnscomment",
|
|
|
|
index_together={("name", "commenttype"), ("domain", "modified_at")},
|
2015-11-05 21:54:21 +01:00
|
|
|
),
|
|
|
|
]
|