# Generated by Django 2.0.2 on 2018-04-05 15:43

from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('coins', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Transaction',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date_created', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('date_modified', models.DateTimeField(auto_now=True, db_index=True)),
                ('order_id', models.UUIDField(default=uuid.uuid4)),
                ('wallet_address', models.CharField(max_length=255, null=True)),
                ('destination_tag', models.PositiveIntegerField(blank=True, default=0, null=True)),
                ('rollback_wallet', models.CharField(max_length=255)),
                ('deposit_tx_hash', models.CharField(blank=True, max_length=255, null=True)),
                ('deposit_tx_amount', models.FloatField(default=0)),
                ('deposit_tx_confirmations', models.PositiveIntegerField(default=0)),
                ('status', models.CharField(choices=[('submitted', 'Submitted'), ('awaiting', 'Waiting for deposit'), ('deposit_received', 'Deposit received'), ('waiting_for_confirmation', 'Waiting for confirmation'), ('exchange', 'Exchanging'), ('out_order', 'Out of order'), ('completed', 'Completed'), ('refunded', 'Refunded'), ('partial_filled', 'Partially Filled')], db_index=True, default='submitted', max_length=100)),
                ('note', models.TextField(blank=True, max_length=255, null=True)),
                ('exchange_rate', models.FloatField(default=0)),
                ('withdraw_amount', models.FloatField(default=0)),
                ('deposit', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='deposit_coin', to='coins.Coin')),
            ],
            options={
                'ordering': ['-pk'],
            },
        ),
        migrations.CreateModel(
            name='TransactionOutputs',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('address', models.CharField(max_length=200)),
                ('value', models.FloatField()),
                ('amount', models.FloatField(default=0)),
                ('tx_hash', models.CharField(max_length=255, null=True)),
                ('comment', models.TextField(null=True)),
            ],
            options={
                'ordering': ['-pk'],
            },
        ),
        migrations.AddField(
            model_name='transaction',
            name='outs',
            field=models.ManyToManyField(related_name='transaction_outputs', to='transactions.TransactionOutputs'),
        ),
        migrations.AddField(
            model_name='transaction',
            name='withdraw',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='withdrawal_coin', to='coins.Coin'),
        ),
    ]
