# Generated by Django 2.1.11 on 2019-08-13 10:41

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


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')),
                ('name', models.CharField(max_length=20, unique=True, verbose_name='name')),
                ('iso_code', models.CharField(max_length=5, unique=True, verbose_name='iso code')),
            ],
            options={
                'verbose_name': 'currency',
                'verbose_name_plural': 'currencies',
            },
        ),
        migrations.CreateModel(
            name='ExchangeRate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('rate', models.DecimalField(decimal_places=7, max_digits=10, verbose_name='rate')),
                ('valid_date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='valid date')),
                ('currency', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='exchange_rates', to='converter.Currency', verbose_name='currency')),
            ],
            options={
                'verbose_name': 'exchange rate',
                'verbose_name_plural': 'exchange rates',
                'permissions': [('update_exchange_rates', 'user can update exchange rates')],
            },
        ),
        migrations.AlterUniqueTogether(
            name='exchangerate',
            unique_together={('valid_date', 'currency')},
        ),
    ]
