# Generated by Django 2.2 on 2019-09-23 15:32

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Campaign',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date_created', models.DateTimeField(auto_now_add=True)),
                ('date_modified', models.DateTimeField(auto_now_add=True)),
                ('campaign_name', models.CharField(max_length=100, unique=True, validators=[django.core.validators.MaxLengthValidator(100, message='The campaign name must not be more than 100 characters'), django.core.validators.MinLengthValidator(3, message='The campaign name must be more than 3 chaaracters')])),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MessageTemplates',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date_created', models.DateTimeField(auto_now_add=True)),
                ('date_modified', models.DateTimeField(auto_now_add=True)),
                ('template', models.CharField(max_length=5000, validators=[django.core.validators.MaxLengthValidator(5000, message='The template to be sent must not be more than 5000 characters'), django.core.validators.MinLengthValidator(10, message='The template must be more than 3 characters')])),
                ('uuid', models.CharField(max_length=36, unique=True, validators=[django.core.validators.MaxLengthValidator(36, message='The template UUID can only be 36 characters'), django.core.validators.MinLengthValidator(36, message='The template UUID can only be 36 characters')])),
                ('campaign', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='sms_app.Campaign')),
            ],
            options={
                'unique_together': {('uuid', 'campaign')},
            },
        ),
        migrations.CreateModel(
            name='Recepients',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date_created', models.DateTimeField(auto_now_add=True)),
                ('date_modified', models.DateTimeField(auto_now_add=True)),
                ('first_name', models.CharField(blank=True, max_length=30, null=True, validators=[django.core.validators.MaxLengthValidator(30, message='The first name must be less than 30 characters'), django.core.validators.RegexValidator(message='A name should only contain letters', regex='^[a-zA-Z]*$')])),
                ('other_names', models.CharField(blank=True, max_length=100, null=True, validators=[django.core.validators.MaxLengthValidator(100, message='The other names must be less than 100 characters'), django.core.validators.RegexValidator(message='A name should only contain letters', regex='^[a-zA-Z]*$')])),
                ('recepient_no', models.CharField(max_length=15, validators=[django.core.validators.MaxLengthValidator(15, message='The recepient number must not be more than 15 characters long'), django.core.validators.RegexValidator(message='The phone number should be in the format +1xxxxxxxxxxx with no spaces', regex='^\\+\\d+$')])),
                ('recepient_alternative_no', models.CharField(blank=True, max_length=15, validators=[django.core.validators.MaxLengthValidator(15, message='The recepient alternative number must not be more than 15 characters long'), django.core.validators.RegexValidator(message='The phone number should be in the format +1xxxxxxxxxxx with no spaces', regex='^\\+\\d+$')])),
            ],
            options={
                'unique_together': {('recepient_no', 'first_name', 'other_names')},
            },
        ),
        migrations.CreateModel(
            name='SMSQueue',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date_created', models.DateTimeField(auto_now_add=True)),
                ('date_modified', models.DateTimeField(auto_now_add=True)),
                ('message', models.CharField(max_length=5000, validators=[django.core.validators.MaxLengthValidator(5000, message='The message to be sent must not be more than 5000 characters'), django.core.validators.MinLengthValidator(10, message='The coop name must be more than 3 characters')])),
                ('recepient_no', models.CharField(max_length=15, validators=[django.core.validators.MaxLengthValidator(15, message='The recepient number must not be more than 15 characters long')])),
                ('msg_status', models.CharField(max_length=15, validators=[django.core.validators.MaxLengthValidator(15, message='The status must not be more than 15 characters long')])),
                ('schedule_time', models.DateTimeField()),
                ('in_queue', models.BooleanField(default=0)),
                ('queue_time', models.DateTimeField(blank=True, default=None, null=True)),
                ('delivery_time', models.DateTimeField(blank=True, default=None, null=True)),
                ('recepient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='sms_app.Recepients')),
                ('template', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='sms_app.MessageTemplates')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
