# Generated by Django 3.1.5 on 2021-03-07 15:03

from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Balance',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('amount', models.DecimalField(decimal_places=9, default=0.0, max_digits=30, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(18446744073709551616)])),
                ('locked_amount', models.DecimalField(decimal_places=9, default=0.0, max_digits=30, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(18446744073709551616)])),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Currency',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('name', models.CharField(max_length=255, unique=True)),
                ('symbol', models.SlugField(max_length=255, unique=True)),
            ],
            options={
                'verbose_name_plural': 'currencies',
            },
        ),
        migrations.CreateModel(
            name='Withdrawal',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('amount', models.DecimalField(decimal_places=9, default=0.0, max_digits=30, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(18446744073709551616)])),
                ('status', models.CharField(choices=[('awaiting transaction signature', 'awaiting transaction signature'), ('awaiting confirmation', 'awaiting confirmation'), ('finished', 'finished'), ('canceled', 'canceled')], max_length=255)),
                ('confirmations', models.IntegerField(default=0, validators=[django.core.validators.MinValueValidator(0)])),
                ('tx_slate_id', models.CharField(max_length=255, unique=True)),
                ('kernel_excess', models.CharField(blank=True, max_length=255, null=True, unique=True)),
                ('balance', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='withdrawals', to='api.balance')),
            ],
            options={
                'ordering': ['created'],
            },
        ),
        migrations.CreateModel(
            name='Deposit',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('amount', models.DecimalField(decimal_places=9, default=0.0, max_digits=30, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(18446744073709551616)])),
                ('status', models.CharField(choices=[('awaiting transaction signature', 'awaiting transaction signature'), ('awaiting confirmation', 'awaiting confirmation'), ('finished', 'finished'), ('canceled', 'canceled')], max_length=255)),
                ('confirmations', models.IntegerField(default=0, validators=[django.core.validators.MinValueValidator(0)])),
                ('tx_slate_id', models.CharField(max_length=255, unique=True)),
                ('kernel_excess', models.CharField(blank=True, max_length=255, null=True, unique=True)),
                ('balance', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='deposits', to='api.balance')),
            ],
            options={
                'ordering': ['created'],
            },
        ),
        migrations.AddField(
            model_name='balance',
            name='currency',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='balances', to='api.currency'),
        ),
        migrations.AddField(
            model_name='balance',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='balances', to=settings.AUTH_USER_MODEL),
        ),
    ]
