# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-05-08 22:36
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    dependencies = [
        ('api', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Address',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('CREATE_TIMESTAMP', models.DateTimeField(auto_now_add=True, null=True)),
                ('UPDATE_TIMESTAMP', models.DateTimeField(auto_now=True, null=True)),
                ('addressee', models.TextField(blank=True, null=True)),
                ('civicAddress', models.TextField(blank=True, null=True)),
                ('city', models.TextField(blank=True, null=True)),
                ('province', models.TextField(blank=True, null=True)),
                ('postalCode', models.TextField(blank=True, null=True)),
                ('country', models.TextField(blank=True, null=True)),
                ('addressType', models.TextField(blank=True, null=True)),
                ('startDate', models.DateField(default=django.utils.timezone.now)),
                ('endDate', models.DateField(blank=True, null=True)),
            ],
            options={
                'db_table': 'ADDRESS',
            },
        ),
        migrations.CreateModel(
            name='Claim',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('CREATE_TIMESTAMP', models.DateTimeField(auto_now_add=True, null=True)),
                ('UPDATE_TIMESTAMP', models.DateTimeField(auto_now=True, null=True)),
                ('name', models.TextField(blank=True, null=True)),
                ('value', models.TextField(blank=True, null=True)),
                ('startDate', models.DateField(default=django.utils.timezone.now)),
                ('endDate', models.DateField(blank=True, null=True)),
            ],
            options={
                'db_table': 'CLAIM',
            },
        ),
        migrations.CreateModel(
            name='Contact',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('CREATE_TIMESTAMP', models.DateTimeField(auto_now_add=True, null=True)),
                ('UPDATE_TIMESTAMP', models.DateTimeField(auto_now=True, null=True)),
                ('text', models.TextField()),
                ('type', models.TextField()),
                ('startDate', models.DateField(default=django.utils.timezone.now)),
                ('endDate', models.DateField(blank=True, null=True)),
            ],
            options={
                'db_table': 'CONTACT',
            },
        ),
        migrations.CreateModel(
            name='Credential',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('CREATE_TIMESTAMP', models.DateTimeField(auto_now_add=True, null=True)),
                ('UPDATE_TIMESTAMP', models.DateTimeField(auto_now=True, null=True)),
                ('startDate', models.DateField(default=django.utils.timezone.now)),
                ('endDate', models.DateField(blank=True, null=True)),
            ],
            options={
                'db_table': 'CREDENTIAL',
            },
        ),
        migrations.CreateModel(
            name='CredentialType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('CREATE_TIMESTAMP', models.DateTimeField(auto_now_add=True, null=True)),
                ('UPDATE_TIMESTAMP', models.DateTimeField(auto_now=True, null=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('processorConfig', models.TextField()),
                ('startDate', models.DateField(default=django.utils.timezone.now)),
                ('endDate', models.DateField(blank=True, null=True)),
            ],
            options={
                'db_table': 'CREDENTIAL_TYPE',
            },
        ),
        migrations.CreateModel(
            name='Issuer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('CREATE_TIMESTAMP', models.DateTimeField(auto_now_add=True, null=True)),
                ('UPDATE_TIMESTAMP', models.DateTimeField(auto_now=True, null=True)),
                ('did', models.TextField()),
                ('url', models.TextField()),
                ('startDate', models.DateField(default=django.utils.timezone.now)),
                ('endDate', models.DateField(blank=True, null=True)),
            ],
            options={
                'db_table': 'ISSUER',
            },
        ),
        migrations.CreateModel(
            name='Name',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('CREATE_TIMESTAMP', models.DateTimeField(auto_now_add=True, null=True)),
                ('UPDATE_TIMESTAMP', models.DateTimeField(auto_now=True, null=True)),
                ('text', models.TextField(blank=True, null=True)),
                ('type', models.TextField(blank=True, null=True)),
                ('startDate', models.DateField(default=django.utils.timezone.now)),
                ('endDate', models.DateField(blank=True, null=True)),
                ('credential', models.ManyToManyField(related_name='names', to='api.Credential')),
            ],
            options={
                'db_table': 'NAME',
            },
        ),
        migrations.CreateModel(
            name='Person',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('CREATE_TIMESTAMP', models.DateTimeField(auto_now_add=True, null=True)),
                ('UPDATE_TIMESTAMP', models.DateTimeField(auto_now=True, null=True)),
                ('fullName', models.TextField()),
                ('type', models.TextField()),
                ('startDate', models.DateField(default=django.utils.timezone.now)),
                ('endDate', models.DateField(blank=True, null=True)),
                ('credential', models.ManyToManyField(related_name='people', to='api.Credential')),
            ],
            options={
                'db_table': 'PERSON',
            },
        ),
        migrations.CreateModel(
            name='Schema',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('CREATE_TIMESTAMP', models.DateTimeField(auto_now_add=True, null=True)),
                ('UPDATE_TIMESTAMP', models.DateTimeField(auto_now=True, null=True)),
                ('name', models.TextField()),
                ('version', models.TextField()),
                ('publisherDid', models.TextField()),
                ('startDate', models.DateField(default=django.utils.timezone.now)),
                ('endDate', models.DateField(blank=True, null=True)),
            ],
            options={
                'db_table': 'SCHEMA',
            },
        ),
        migrations.CreateModel(
            name='Subject',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('CREATE_TIMESTAMP', models.DateTimeField(auto_now_add=True, null=True)),
                ('UPDATE_TIMESTAMP', models.DateTimeField(auto_now=True, null=True)),
                ('sourceId', models.TextField(blank=True, null=True)),
                ('startDate', models.DateField(default=django.utils.timezone.now)),
                ('endDate', models.DateField(blank=True, null=True)),
                ('initialCredential', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='subjects', to='api.Credential')),
            ],
            options={
                'db_table': 'SUBJECT',
            },
        ),
        migrations.AddField(
            model_name='credentialtype',
            name='issuer',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='credential_types', to='api.Issuer'),
        ),
        migrations.AddField(
            model_name='credentialtype',
            name='schema',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='credential_types', to='api.Schema'),
        ),
        migrations.AddField(
            model_name='credential',
            name='credentialType',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='credentials', to='api.CredentialType'),
        ),
        migrations.AddField(
            model_name='credential',
            name='subject',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='credentials', to='api.Subject'),
        ),
        migrations.AddField(
            model_name='contact',
            name='credential',
            field=models.ManyToManyField(related_name='contacts', to='api.Credential'),
        ),
        migrations.AddField(
            model_name='claim',
            name='credential',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='claims', to='api.Credential'),
        ),
        migrations.AddField(
            model_name='address',
            name='credential',
            field=models.ManyToManyField(related_name='addresses', to='api.Credential'),
        ),
    ]
