# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-07-21 11:29
from __future__ import unicode_literals
import logging

from django.db import migrations, connection

logger = logging.getLogger(__name__)

def forward(apps, schema_editor):

    with connection.cursor() as cursor:
        cursor.execute("SELECT applied FROM django_migrations WHERE name='0028_auto_20170619_1555'")
        start_date = cursor.fetchone()[0]
        cursor.execute("SELECT applied FROM django_migrations WHERE name='0024_auto_20170602_2304'")
        end_date = cursor.fetchone()[0]

    TaskMemberStatusLog = apps.get_model('tasks', 'TaskMemberStatusLog')

    for status_log in TaskMemberStatusLog.objects.filter(start__range=(start_date, end_date)):
        new_date = status_log.task_member.task.deadline
        TaskMemberStatusLog.objects.filter(id=status_log.id).update(start=new_date)

    TaskStatusLog = apps.get_model('tasks', 'TaskStatusLog')

    for status_log in TaskStatusLog.objects.filter(start__range=(start_date, end_date)):
        new_date = status_log.task.deadline
        TaskStatusLog.objects.filter(id=status_log.id).update(start=new_date)

def backward(apps, schema_editor):
    pass

class Migration(migrations.Migration):
    """
    This migration fixes wrongly created start datetimestamp for taskmemberstatuslogs in migration
    0024_auto_20170602_2304
    """
    dependencies = [
        ('projects', '0028_auto_20170619_1555'),
        ('tasks', '0024_auto_20170602_2304'),
        ('tasks', '0028_auto_20170817_1546'),
    ]

    operations = [
        migrations.RunPython(forward, backward),
    ]

300325c5dc77d5b7c0f7b1257a8517df766ea9e6
<mask token>


def backward(apps, schema_editor):
    pass


class Migration(migrations.Migration):
    """
    This migration fixes wrongly created start datetimestamp for taskmemberstatuslogs in migration
    0024_auto_20170602_2304
    """
    dependencies = [('projects', '0028_auto_20170619_1555'), ('tasks',
        '0024_auto_20170602_2304'), ('tasks', '0028_auto_20170817_1546')]
    operations = [migrations.RunPython(forward, backward)]

<mask token>


def forward(apps, schema_editor):
    with connection.cursor() as cursor:
        cursor.execute(
            "SELECT applied FROM django_migrations WHERE name='0028_auto_20170619_1555'"
            )
        start_date = cursor.fetchone()[0]
        cursor.execute(
            "SELECT applied FROM django_migrations WHERE name='0024_auto_20170602_2304'"
            )
        end_date = cursor.fetchone()[0]
    TaskMemberStatusLog = apps.get_model('tasks', 'TaskMemberStatusLog')
    for status_log in TaskMemberStatusLog.objects.filter(start__range=(
        start_date, end_date)):
        new_date = status_log.task_member.task.deadline
        TaskMemberStatusLog.objects.filter(id=status_log.id).update(start=
            new_date)
    TaskStatusLog = apps.get_model('tasks', 'TaskStatusLog')
    for status_log in TaskStatusLog.objects.filter(start__range=(start_date,
        end_date)):
        new_date = status_log.task.deadline
        TaskStatusLog.objects.filter(id=status_log.id).update(start=new_date)


def backward(apps, schema_editor):
    pass


class Migration(migrations.Migration):
    """
    This migration fixes wrongly created start datetimestamp for taskmemberstatuslogs in migration
    0024_auto_20170602_2304
    """
    dependencies = [('projects', '0028_auto_20170619_1555'), ('tasks',
        '0024_auto_20170602_2304'), ('tasks', '0028_auto_20170817_1546')]
    operations = [migrations.RunPython(forward, backward)]

<mask token>
logger = logging.getLogger(__name__)


def forward(apps, schema_editor):
    with connection.cursor() as cursor:
        cursor.execute(
            "SELECT applied FROM django_migrations WHERE name='0028_auto_20170619_1555'"
            )
        start_date = cursor.fetchone()[0]
        cursor.execute(
            "SELECT applied FROM django_migrations WHERE name='0024_auto_20170602_2304'"
            )
        end_date = cursor.fetchone()[0]
    TaskMemberStatusLog = apps.get_model('tasks', 'TaskMemberStatusLog')
    for status_log in TaskMemberStatusLog.objects.filter(start__range=(
        start_date, end_date)):
        new_date = status_log.task_member.task.deadline
        TaskMemberStatusLog.objects.filter(id=status_log.id).update(start=
            new_date)
    TaskStatusLog = apps.get_model('tasks', 'TaskStatusLog')
    for status_log in TaskStatusLog.objects.filter(start__range=(start_date,
        end_date)):
        new_date = status_log.task.deadline
        TaskStatusLog.objects.filter(id=status_log.id).update(start=new_date)


def backward(apps, schema_editor):
    pass


class Migration(migrations.Migration):
    """
    This migration fixes wrongly created start datetimestamp for taskmemberstatuslogs in migration
    0024_auto_20170602_2304
    """
    dependencies = [('projects', '0028_auto_20170619_1555'), ('tasks',
        '0024_auto_20170602_2304'), ('tasks', '0028_auto_20170817_1546')]
    operations = [migrations.RunPython(forward, backward)]

from __future__ import unicode_literals
import logging
from django.db import migrations, connection
logger = logging.getLogger(__name__)


def forward(apps, schema_editor):
    with connection.cursor() as cursor:
        cursor.execute(
            "SELECT applied FROM django_migrations WHERE name='0028_auto_20170619_1555'"
            )
        start_date = cursor.fetchone()[0]
        cursor.execute(
            "SELECT applied FROM django_migrations WHERE name='0024_auto_20170602_2304'"
            )
        end_date = cursor.fetchone()[0]
    TaskMemberStatusLog = apps.get_model('tasks', 'TaskMemberStatusLog')
    for status_log in TaskMemberStatusLog.objects.filter(start__range=(
        start_date, end_date)):
        new_date = status_log.task_member.task.deadline
        TaskMemberStatusLog.objects.filter(id=status_log.id).update(start=
            new_date)
    TaskStatusLog = apps.get_model('tasks', 'TaskStatusLog')
    for status_log in TaskStatusLog.objects.filter(start__range=(start_date,
        end_date)):
        new_date = status_log.task.deadline
        TaskStatusLog.objects.filter(id=status_log.id).update(start=new_date)


def backward(apps, schema_editor):
    pass


class Migration(migrations.Migration):
    """
    This migration fixes wrongly created start datetimestamp for taskmemberstatuslogs in migration
    0024_auto_20170602_2304
    """
    dependencies = [('projects', '0028_auto_20170619_1555'), ('tasks',
        '0024_auto_20170602_2304'), ('tasks', '0028_auto_20170817_1546')]
    operations = [migrations.RunPython(forward, backward)]

# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-07-21 11:29
from __future__ import unicode_literals
import logging

from django.db import migrations, connection

logger = logging.getLogger(__name__)

def forward(apps, schema_editor):

    with connection.cursor() as cursor:
        cursor.execute("SELECT applied FROM django_migrations WHERE name='0028_auto_20170619_1555'")
        start_date = cursor.fetchone()[0]
        cursor.execute("SELECT applied FROM django_migrations WHERE name='0024_auto_20170602_2304'")
        end_date = cursor.fetchone()[0]

    TaskMemberStatusLog = apps.get_model('tasks', 'TaskMemberStatusLog')

    for status_log in TaskMemberStatusLog.objects.filter(start__range=(start_date, end_date)):
        new_date = status_log.task_member.task.deadline
        TaskMemberStatusLog.objects.filter(id=status_log.id).update(start=new_date)

    TaskStatusLog = apps.get_model('tasks', 'TaskStatusLog')

    for status_log in TaskStatusLog.objects.filter(start__range=(start_date, end_date)):
        new_date = status_log.task.deadline
        TaskStatusLog.objects.filter(id=status_log.id).update(start=new_date)

def backward(apps, schema_editor):
    pass

class Migration(migrations.Migration):
    """
    This migration fixes wrongly created start datetimestamp for taskmemberstatuslogs in migration
    0024_auto_20170602_2304
    """
    dependencies = [
        ('projects', '0028_auto_20170619_1555'),
        ('tasks', '0024_auto_20170602_2304'),
        ('tasks', '0028_auto_20170817_1546'),
    ]

    operations = [
        migrations.RunPython(forward, backward),
    ]
