# Generated by Django 3.1.5 on 2021-02-08 00:00

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Currency',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(choices=[('JPY', 'Japanese yen'), ('BGN', 'Bulgarian lev'), ('CZK', 'Czech koruna'), ('DKK', 'Danish krone'), ('EEK', 'Estonian kroon'), ('GBP', 'Pound sterling'), ('HUF', 'Hungarian forint'), ('PLN', 'Polish zloty'), ('RON', 'Romanian leu'), ('SEK', 'Swedish krona'), ('CHF', 'Swiss franc'), ('ISK', 'Icelandic krona'), ('NOK', 'Norwegian krone'), ('HRK', 'Croatian kuna'), ('RUB', 'Russian rouble'), ('TRY', 'Turkish lira'), ('AUD', 'Australian dollar'), ('BRL', 'Brasilian real'), ('CAD', 'Canadian dollar'), ('CNY', 'Chinese yuan renminbi'), ('HKD', 'Hong Kong dollar'), ('IDR', 'Indonesian rupiah'), ('INR', 'Indian rupee'), ('KRW', 'South Korean won'), ('MXN', 'Mexican peso'), ('MYR', 'Malaysian ringgit'), ('NZD', 'New Zealand dollar'), ('PHP', 'Philippine peso'), ('SGD', 'Singapore dollar'), ('THB', 'Thai baht'), ('ZAR', 'South African rand')], max_length=3, unique=True, verbose_name='code')),
                ('update', models.BooleanField(default=True, verbose_name='update')),
                ('last_updated', models.DateTimeField(blank=True, help_text='Last successful update from ecb rss feed.', null=True, verbose_name='last updated')),
            ],
            options={
                'verbose_name': 'currency',
                'verbose_name_plural': 'currencies',
            },
        ),
        migrations.CreateModel(
            name='ExchangeRateLog',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('exchange_rate', models.DecimalField(decimal_places=4, max_digits=20, verbose_name='exchange rate')),
                ('ecb_updated', models.DateTimeField(verbose_name='ecb updated')),
                ('currency', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='exchange_rate_logs', to='rates.currency', verbose_name='currency')),
            ],
            options={
                'verbose_name': 'exchange rate log',
                'verbose_name_plural': 'exchange rate logs',
                'unique_together': {('currency', 'ecb_updated')},
            },
        ),
    ]
