# Generated by Django 2.0.8 on 2018-08-27 15:14

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Call',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(db_index=True, default=django.utils.timezone.now, editable=False)),
                ('spooled', models.DateTimeField(editable=False, null=True)),
                ('started', models.DateTimeField(editable=False, null=True)),
                ('ended', models.DateTimeField(editable=False, null=True)),
                ('result', picklefield.fields.PickledObjectField(editable=False, null=True)),
                ('exception', models.TextField(default='', editable=False)),
                ('status', models.IntegerField(choices=[(0, 'Created'), (1, 'Spooled'), (2, 'Started'), (3, 'Success'), (5, 'Failure')], db_index=True, default=0, editable=False)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Caller',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.IntegerField(choices=[(0, 'Created'), (1, 'Spooled'), (2, 'Started'), (3, 'Success'), (4, 'Retrying'), (5, 'Failure')], db_index=True, default=0, editable=False)),
                ('created', models.DateTimeField(db_index=True, default=django.utils.timezone.now, editable=False)),
                ('spooled', models.DateTimeField(editable=False, null=True)),
                ('started', models.DateTimeField(editable=False, null=True)),
                ('ended', models.DateTimeField(editable=False, null=True)),
                ('kwargs', picklefield.fields.PickledObjectField(editable=False, null=True)),
                ('callback', models.CharField(db_index=True, max_length=255)),
                ('max_attempts', models.IntegerField(default=0)),
                ('spooler', models.CharField(blank=True, max_length=100, null=True)),
                ('priority', models.IntegerField(blank=True, null=True)),
                ('parent', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, to='djcall.Caller')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Cron',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('minute', models.CharField(default='*', max_length=50)),
                ('hour', models.CharField(default='*', max_length=50)),
                ('day', models.CharField(default='*', max_length=50)),
                ('month', models.CharField(default='*', max_length=50)),
                ('weekday', models.CharField(default='*', max_length=50)),
                ('caller', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='djcall.Caller')),
            ],
        ),
        migrations.AddField(
            model_name='call',
            name='caller',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='djcall.Caller'),
        ),
        migrations.AddField(
            model_name='call',
            name='parent',
            field=models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, to='djcall.Call'),
        ),
    ]
