# -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-08-08 13:42
from __future__ import unicode_literals

from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('tracker', '0013_auto_20160808_1641'),
    ]

    operations = [
        migrations.CreateModel(
            name='Maintainer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('contact', models.CharField(blank=True, max_length=16, validators=[django.core.validators.RegexValidator(message='Phone number must be in the format +123456789 (from 9 to 15 digits).', regex='^\\+?1?\\d{9,15}')])),
            ],
        ),
        migrations.CreateModel(
            name='Maintenance',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('request_name', models.CharField(max_length=25)),
                ('description', models.CharField(max_length=200)),
                ('time_requested', models.DateTimeField(default=django.utils.timezone.now)),
                ('approval_status', models.CharField(choices=[('approved', 'Approved'), ('rejected', 'Rejected')], default='rejected', max_length=10)),
                ('progress', models.CharField(choices=[('in-progress', 'In Progress'), ('resolved', 'Resolved')], default='in-progress', max_length=12)),
                ('time_resolved', models.DateTimeField(default=django.utils.timezone.now)),
                ('comments', models.CharField(blank=True, default='', max_length=150)),
                ('is_seen', models.BooleanField(default=False)),
                ('requested_user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='request_user', to=settings.AUTH_USER_MODEL)),
                ('user', models.ManyToManyField(related_name='user_maintainer', through='tracker.Maintainer', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='maintainer',
            name='maintenance',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tracker.Maintenance'),
        ),
        migrations.AddField(
            model_name='maintainer',
            name='user',
            field=models.ForeignKey(default=3, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
    ]
