# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-21 00:54
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    dependencies = [
        ('data', '0010_auto_20170219_0948'),
    ]

    operations = [
        migrations.CreateModel(
            name='MetricValue',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField()),
                ('value', models.FloatField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.AddField(
            model_name='metric',
            name='description',
            field=models.TextField(blank=True, null=True),
        ),
        # Index migration needs to come before remove date column migration
        # because the date column was a part of the previous index.
        migrations.AlterUniqueTogether(
            name='metric',
            unique_together=set([('company', 'name', 'interval', 'estimated')]),
        ),
        migrations.RemoveField(
            model_name='metric',
            name='date',
        ),
        migrations.RemoveField(
            model_name='metric',
            name='value',
        ),
        migrations.AddField(
            model_name='metricvalue',
            name='metric',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='metric_values', to='data.Metric'),
        ),
        migrations.AlterUniqueTogether(
            name='metricvalue',
            unique_together=set([('metric', 'date')]),
        ),
    ]
