# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models
import django_extensions.db.fields
from django.conf import settings
import django.utils.timezone


class Migration(migrations.Migration):

    dependencies = [
        ('sync', '0002_auto_20150831_1334'),
        ('accounts', '0026_mtpuser_created_from'),
    ]

    operations = [
        migrations.CreateModel(
            name='DuplicatedMTPUser',
            fields=[
                ('id', django_extensions.db.fields.UUIDField(editable=False, serialize=False, primary_key=True, blank=True)),
                ('is_deleted', models.BooleanField(default=False)),
                ('update_locally', models.BooleanField(default=False)),
                ('date', models.DateTimeField(default=django.utils.timezone.now)),
                ('duplicate_user', models.ForeignKey(related_name='duplicate_user_duplicates', to=settings.AUTH_USER_MODEL)),
                ('first_update', models.ForeignKey(null=True, related_name='accounts_duplicatedmtpuser_by_first', to='sync.Update', blank=True)),
                ('last_update', models.ForeignKey(null=True, related_name='accounts_duplicatedmtpuser_by_last', to='sync.Update', blank=True)),
                ('origin_user', models.ForeignKey(related_name='duplicate_user_origins', to=settings.AUTH_USER_MODEL)),
                ('original_user', models.ForeignKey(related_name='duplicate_user_originals', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='mtpuser',
            name='duplicates',
            field=models.ManyToManyField(related_name='original_users', to=settings.AUTH_USER_MODEL, through='accounts.DuplicatedMTPUser'),
        ),
    ]
