# Generated by Django 2.1.3 on 2018-12-18 23:14

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0009_alter_user_last_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='Credential',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=256)),
                ('content', models.TextField()),
                ('transaction_id', models.TextField(blank=True, null=True)),
                ('created_on', models.DateTimeField(default=django.utils.timezone.now)),
                ('status', models.CharField(max_length=30)),
            ],
            options={
                'permissions': (('view_all_credentials', 'Can see all credentials associated with the user'), ('issue_credentials', 'Can issue credentials to other users'), ('own_credentials', 'Can own credentials issued by other users'), ('verify_credentials', 'Can verify credentials')),
            },
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
                ('description', models.CharField(max_length=256)),
                ('organization', models.CharField(blank=True, max_length=256, null=True)),
                ('public_key', models.CharField(blank=True, max_length=256, null=True)),
                ('private_key', models.CharField(blank=True, max_length=256, null=True)),
                ('cert_template', models.TextField(blank=True, null=True)),
            ],
            options={
                'permissions': (('view_issuer_profiles', 'Can see users who issue credentials'), ('view_owner_profiles', 'Can see users who own credentials')),
            },
        ),
        migrations.AddField(
            model_name='credential',
            name='issuer',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='issuers', to='cert.Profile'),
        ),
        migrations.AddField(
            model_name='credential',
            name='owner',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='owners', to='cert.Profile'),
        ),
    ]
