# Generated by Django 2.2.7 on 2019-11-25 20:13

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')),
                ('abbreviation', models.CharField(max_length=3)),
                ('name', models.CharField(max_length=20)),
            ],
        ),
        migrations.CreateModel(
            name='CurrencyRate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('rate', models.DecimalField(decimal_places=2, max_digits=10)),
                ('date', models.DateTimeField(auto_now_add=True)),
                ('currency1', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='currency_rates1', to='core.Currency')),
                ('currency2', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='currency_rates2', to='core.Currency')),
            ],
        ),
        migrations.AddField(
            model_name='currency',
            name='target_currency',
            field=models.ManyToManyField(related_name='rates', through='core.CurrencyRate', to='core.Currency'),
        ),
    ]
