# Generated by Django 2.2.9 on 2020-01-30 13:14

from django.db import migrations, models
import django.db.models.deletion
import hub20.apps.blockchain.fields
import hub20.apps.ethereum_money.models


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='EthereumAccount',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('address', hub20.apps.blockchain.fields.EthereumAddressField(db_index=True, unique=True)),
                ('private_key', hub20.apps.blockchain.fields.HexField(max_length=64, unique=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='EthereumToken',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('chain', models.PositiveIntegerField(choices=[(1, 'Mainnet'), (2, 'Test Network'), (3, 'Ropsten'), (4, 'Rinkeby'), (5, 'Görli'), (42, 'Kovan')])),
                ('code', models.CharField(max_length=8)),
                ('name', models.CharField(max_length=500)),
                ('decimals', models.PositiveIntegerField(default=18)),
                ('address', hub20.apps.blockchain.fields.EthereumAddressField(default='0x0000000000000000000000000000000000000000')),
            ],
            options={
                'unique_together': {('chain', 'address')},
            },
        ),
        migrations.CreateModel(
            name='AccountBalanceEntry',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', hub20.apps.ethereum_money.models.EthereumTokenAmountField(decimal_places=18, max_digits=32)),
                ('account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='balance_entries', to='ethereum_money.EthereumAccount')),
                ('currency', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='ethereum_money.EthereumToken')),
                ('transaction', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='blockchain.Transaction')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
