# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-09-28 11:23
from __future__ import unicode_literals

from django.db import migrations


def set_project(apps, schema_editor):
    Value = apps.get_model('projects', 'Value')
    Snapshot = apps.get_model('projects', 'Snapshot')
    for value in Value.objects.all():
        value.project = value.snapshot.project
        value.snapshot = None
        value.save()

    for snapshot in Snapshot.objects.all():
        snapshot.delete()


class Migration(migrations.Migration):

    dependencies = [
        ('projects', '0006_project_values'),
    ]

    operations = [
        migrations.RunPython(set_project),
    ]
