# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-15 22:25
from __future__ import unicode_literals

import uuid

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


class Migration(migrations.Migration):

    dependencies = [
        ("studies", "0046_feedback-related-managers"),
        ("accounts", "0039_auto_20180219_1259"),
    ]

    operations = [
        migrations.CreateModel(
            name="Message",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "uuid",
                    models.UUIDField(db_index=True, default=uuid.uuid4, unique=True),
                ),
                ("date_created", models.DateTimeField(auto_now_add=True)),
                ("subject", models.CharField(max_length=255)),
                ("body", models.TextField()),
                ("email_sent_timestamp", models.DateTimeField(default=None, null=True)),
                (
                    "recipients",
                    models.ManyToManyField(
                        related_name="messages", to=settings.AUTH_USER_MODEL
                    ),
                ),
                (
                    "related_study",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        to="studies.Study",
                    ),
                ),
                (
                    "sender",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
        )
    ]
