# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-03 15:47
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Rate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('currency', models.CharField(max_length=3)),
                ('value', models.DecimalField(decimal_places=6, max_digits=14)),
                ('date', models.DateField(auto_now_add=True, db_index=True)),
            ],
        ),
        migrations.CreateModel(
            name='RateSource',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('base_currency', models.CharField(blank=True, default='EUR', max_length=3)),
                ('last_update', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.AlterUniqueTogether(
            name='ratesource',
            unique_together=set([('name', 'base_currency')]),
        ),
        migrations.AddField(
            model_name='rate',
            name='source',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='rates', related_query_name='rate', to='txmoney.RateSource'),
        ),
        migrations.AlterUniqueTogether(
            name='rate',
            unique_together=set([('source', 'currency', 'date')]),
        ),
    ]
