# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-23 01:50
from __future__ import unicode_literals

from django.db import migrations


def save_brewhouses_with_token_and_user(apps, schema_editor):
    """Added programatically calculated Token and User to Brewhouse, so this
    will save all existing Brewhouses to update them with a User and Token.
    """
    Brewhouse = apps.get_model('brewery', 'Brewhouse')
    for brewhouse in Brewhouse.objects.all():
        brewhouse.save()


class Migration(migrations.Migration):

    dependencies = [
        ('brewery', '0007_brewhouse_user'),
    ]

    operations = [
        migrations.RunPython(save_brewhouses_with_token_and_user),
    ]
