# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-26 01:37
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('domain_api', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='IpAddress',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('address', models.CharField(max_length=255, unique=True)),
                ('address_type', models.CharField(choices=[('v4', 'ipv4'), ('v6', 'ipv6')], default='v4', max_length=2)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Nameserver',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('idn_host', models.CharField(max_length=255, unique=True)),
                ('domain_nameservers', models.ManyToManyField(related_name='ns', to='domain_api.RegisteredDomain')),
            ],
        ),
        migrations.CreateModel(
            name='NameserverHost',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('default', models.BooleanField(default=False)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('nameserver', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='domain_api.Nameserver')),
                ('project_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='nameserver_hosts', to=settings.AUTH_USER_MODEL)),
                ('tld_provider', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='domain_api.TopLevelDomainProvider')),
            ],
        ),
        migrations.AddField(
            model_name='ipaddress',
            name='nameserver_host',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='domain_api.NameserverHost'),
        ),
        migrations.AddField(
            model_name='ipaddress',
            name='project_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ip_addresses', to=settings.AUTH_USER_MODEL),
        ),
    ]
