# Generated by Django 2.0.1 on 2018-03-19 07:29

from django.conf import settings
import django.contrib.postgres.fields
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
from django.utils.translation import ugettext_lazy as _


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='ActionLog',
            fields=[
                ('id',
                 models.AutoField(
                     auto_created=True,
                     primary_key=True,
                     serialize=False,
                     verbose_name='ID')),
                ('start_time',
                 models.DateTimeField(
                     blank=True,
                     default=django.utils.timezone.now)),
                ('timestamp',
                 models.DateTimeField(
                     blank=True,
                     default=django.utils.timezone.now)),
                ('exchange',
                 models.CharField(
                     blank=True,
                     default='',
                     max_length=255)),
                ('loop_num',
                 models.IntegerField(
                     blank=True,
                     default=0)),
                ('loop_tag',
                 models.CharField(
                     blank=True,
                     choices=[
                         ('verify_payload',
                          _('Verify payload')),
                         ('balance',
                          _('Check balance')),
                         ('place_order',
                          _('Place order')),
                         ('order_status',
                          _('Order status')),
                         ('final_status',
                          _('Final status')),
                         ('connection_error',
                          _('Connection error'))],
                     default='verify_payload',
                     max_length=255)),
                ('additional_info',
                 django.contrib.postgres.fields.jsonb.JSONField()),
            ],
        ),
        migrations.CreateModel(
            name='TradePlan',
            fields=[
                ('id',
                 models.AutoField(
                     auto_created=True,
                     primary_key=True,
                     serialize=False,
                     verbose_name='ID')),
                ('auth_token',
                 models.CharField(
                     editable=False,
                     max_length=50,
                     unique=True)),
                ('loop',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=django.contrib.postgres.fields.ArrayField(
                         base_field=models.CharField(
                             max_length=255),
                         blank=True,
                         default=[],
                         size=None),
                     size=None)),
                ('amount',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=django.contrib.postgres.fields.ArrayField(
                         base_field=models.CharField(
                             max_length=255),
                         blank=True,
                         default=[],
                         size=None),
                     size=None)),
                ('exec_type',
                 models.CharField(
                     blank=True,
                     choices=[
                         ('sequential',
                          'Sequential'),
                         ('parallel',
                          'Parallel')],
                     default='sequential',
                     max_length=255,
                     verbose_name='exec_type')),
                ('check_balance',
                 models.BooleanField(
                     default=False)),
                ('accepted_at',
                 models.DateTimeField(
                     blank=True,
                     default=django.utils.timezone.now)),
                ('status',
                 models.CharField(
                     blank=True,
                     choices=[
                         ('none',
                          _('Trade not started')),
                         ('progress',
                          _('Trade in progress')),
                         ('step_passed',
                          _('Trade step passed')),
                         ('success',
                          _('Trade success for single exchange')),
                         ('completed',
                          _('Trade completed')),
                         ('failed',
                          _('Trade failed'))],
                     default='none',
                     max_length=255,
                     verbose_name='status')),
                ('user',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='tradeplan',
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='actionlog',
            name='trade_plan',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='actionlog',
                to='pankow.TradePlan'),
        ),
    ]
