# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-11-29 14:38
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Participant',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('uuid', models.UUIDField(default=uuid.uuid4, unique=True)),
                ('first_name', models.CharField(max_length=32)),
                ('last_name', models.CharField(max_length=32)),
                ('email', models.EmailField(blank=True, max_length=254, null=True)),
                ('dob', models.DateField(blank=True, null=True)),
                ('reset_code', models.CharField(max_length=16, null=True)),
                ('join_date', models.DateTimeField(auto_now_add=True)),
                ('email_verified', models.BooleanField(default=False)),
                ('email_verification_date', models.DateTimeField(null=True)),
                ('consent_doc_emailed', models.BooleanField(default=False)),
                ('is_test', models.BooleanField(default=False)),
                ('test_email_regex', models.CharField(max_length=128, null=True)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('modified_on', models.DateTimeField(auto_now=True)),
                ('reset_code_created_date', models.DateTimeField(null=True)),
                ('email_verification_code', models.CharField(blank=True, max_length=100, null=True)),
                ('gcm_token', models.CharField(max_length=256, null=True)),
                ('push_token', models.CharField(max_length=256, null=True)),
                ('enable_notifications', models.BooleanField(default=True)),
                ('survey_notification_time', models.DateTimeField(blank=True, null=True)),
                ('timezone', models.CharField(blank=True, max_length=100, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='ParticipantAuditLogEntry',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('uuid', models.UUIDField(db_index=True, default=uuid.uuid4)),
                ('first_name', models.CharField(max_length=32)),
                ('last_name', models.CharField(max_length=32)),
                ('email', models.EmailField(blank=True, max_length=254, null=True)),
                ('dob', models.DateField(blank=True, null=True)),
                ('reset_code', models.CharField(max_length=16, null=True)),
                ('join_date', models.DateTimeField(auto_now_add=True)),
                ('email_verified', models.BooleanField(default=False)),
                ('email_verification_date', models.DateTimeField(null=True)),
                ('consent_doc_emailed', models.BooleanField(default=False)),
                ('is_test', models.BooleanField(default=False)),
                ('test_email_regex', models.CharField(max_length=128, null=True)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('modified_on', models.DateTimeField(auto_now=True)),
                ('reset_code_created_date', models.DateTimeField(null=True)),
                ('email_verification_code', models.CharField(blank=True, max_length=100, null=True)),
                ('gcm_token', models.CharField(max_length=256, null=True)),
                ('push_token', models.CharField(max_length=256, null=True)),
                ('enable_notifications', models.BooleanField(default=True)),
                ('survey_notification_time', models.DateTimeField(blank=True, null=True)),
                ('timezone', models.CharField(blank=True, max_length=100, null=True)),
                ('action_id', models.AutoField(primary_key=True, serialize=False)),
                ('action_date', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                ('action_type', models.CharField(choices=[('I', 'Created'), ('U', 'Changed'), ('D', 'Deleted')], editable=False, max_length=1)),
                ('action_user', audit_log.models.fields.LastUserField(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='_participant_audit_log_entry', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('-action_date',),
                'default_permissions': (),
            },
        ),
        migrations.CreateModel(
            name='ParticipantNotificationsSent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('notification', models.CharField(max_length=100)),
                ('date', models.DateField(auto_now_add=True)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('participant', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='participant.Participant')),
            ],
        ),
        migrations.CreateModel(
            name='ParticipantNotificationsSentAuditLogEntry',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('notification', models.CharField(max_length=100)),
                ('date', models.DateField(auto_now_add=True)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('action_id', models.AutoField(primary_key=True, serialize=False)),
                ('action_date', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                ('action_type', models.CharField(choices=[('I', 'Created'), ('U', 'Changed'), ('D', 'Deleted')], editable=False, max_length=1)),
                ('action_user', audit_log.models.fields.LastUserField(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='_participantnotificationssent_audit_log_entry', to=settings.AUTH_USER_MODEL)),
                ('participant', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='participant.Participant')),
            ],
            options={
                'ordering': ('-action_date',),
                'default_permissions': (),
            },
        ),
        migrations.CreateModel(
            name='ParticipantStudyConsent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.BooleanField(default=False)),
                ('opt_out', models.BooleanField(default=False)),
                ('opt_out_date', models.DateField(blank=True, null=True)),
                ('opt_out_reason', models.TextField(blank=True, null=True)),
                ('signature', models.TextField()),
                ('guardian_first_name', models.CharField(blank=True, max_length=64, null=True)),
                ('guardian_last_name', models.CharField(blank=True, max_length=64, null=True)),
                ('guardian_email', models.CharField(blank=True, max_length=255, null=True)),
                ('guardian_signature', models.TextField(blank=True, null=True)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('modified_on', models.DateTimeField(auto_now=True)),
                ('participant', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='consents', to='participant.Participant')),
            ],
        ),
        migrations.CreateModel(
            name='ParticipantStudyConsentAuditLogEntry',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('status', models.BooleanField(default=False)),
                ('opt_out', models.BooleanField(default=False)),
                ('opt_out_date', models.DateField(blank=True, null=True)),
                ('opt_out_reason', models.TextField(blank=True, null=True)),
                ('signature', models.TextField()),
                ('guardian_first_name', models.CharField(blank=True, max_length=64, null=True)),
                ('guardian_last_name', models.CharField(blank=True, max_length=64, null=True)),
                ('guardian_email', models.CharField(blank=True, max_length=255, null=True)),
                ('guardian_signature', models.TextField(blank=True, null=True)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('modified_on', models.DateTimeField(auto_now=True)),
                ('action_id', models.AutoField(primary_key=True, serialize=False)),
                ('action_date', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                ('action_type', models.CharField(choices=[('I', 'Created'), ('U', 'Changed'), ('D', 'Deleted')], editable=False, max_length=1)),
                ('action_user', audit_log.models.fields.LastUserField(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='_participantstudyconsent_audit_log_entry', to=settings.AUTH_USER_MODEL)),
                ('participant', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='_auditlog_consents', to='participant.Participant')),
            ],
            options={
                'ordering': ('-action_date',),
                'default_permissions': (),
            },
        ),
    ]
