# -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2016-12-05 15:29
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('sites', '0002_alter_domain_unique'),
    ]

    operations = [
        migrations.CreateModel(
            name='Account',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('key', models.TextField(editable=False)),
                ('name', models.CharField(default=b'New Account', max_length=255)),
                ('directory_url', models.CharField(default=b'https://acme.api.letsencrypt.org/directory', editable=False, max_length=255)),
                ('is_registered', models.BooleanField(default=False)),
                ('country', models.CharField(help_text=b'2 letter country code (ISO 3166-1 alpha-2)', max_length=2)),
                ('state', models.CharField(help_text=b'state or province name', max_length=64)),
                ('locality', models.CharField(help_text=b'e.g. city', max_length=64)),
                ('organization_name', models.CharField(help_text=b'e.g. company name', max_length=64)),
                ('organizational_unit_name', models.CharField(help_text=b'e.g. section', max_length=64)),
                ('email_address', models.EmailField(max_length=254)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Certificate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('key', models.TextField(editable=False)),
                ('domain', models.CharField(blank=True, max_length=255)),
                ('csr', models.TextField(blank=True)),
                ('certificate', models.TextField(blank=True)),
                ('intermediate_certificates', models.TextField(blank=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='autocert.Account')),
                ('site', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='certificate', to='sites.Site')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Challenge',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('domain', models.CharField(max_length=255)),
                ('path', models.CharField(max_length=255)),
                ('validation', models.CharField(max_length=255)),
                ('uri', models.TextField(blank=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('certificate', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='challenges', to='autocert.Certificate')),
            ],
            options={
                'get_latest_by': 'created',
            },
        ),
    ]
