# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-13 18:29
from __future__ import unicode_literals

import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import mac_app.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Department',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('domain', models.CharField(default='corp', max_length=128)),
                ('firstname', models.CharField(blank=True, max_length=128)),
                ('lastname', models.CharField(blank=True, max_length=128)),
                ('address', models.CharField(blank=True, max_length=256)),
                ('city', models.CharField(blank=True, max_length=128)),
                ('state', models.CharField(blank=True, max_length=128)),
                ('postal_code', models.CharField(blank=True, max_length=16)),
                ('phone', models.CharField(blank=True, max_length=16)),
                ('department', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='mac_app.Department')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Ticket',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number', models.CharField(default=mac_app.models.get_new_ticket_number, max_length=32)),
                ('creation_date', models.DateTimeField(default=datetime.datetime.now, verbose_name='date created')),
                ('dsk_stage', models.IntegerField(default=0)),
                ('net_stage', models.IntegerField(default=0)),
                ('fac_stage', models.IntegerField(default=0)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tickets_started', to=settings.AUTH_USER_MODEL)),
                ('target', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tickets', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='TicketNote',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('creation_date', models.DateTimeField(default=datetime.datetime.now, verbose_name='date created')),
                ('content', models.TextField(blank=True)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('ticket', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mac_app.Ticket')),
            ],
        ),
        migrations.CreateModel(
            name='TicketType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=16)),
                ('dsk_seq', models.IntegerField(default=0, verbose_name='Desktop Sequence')),
                ('dsk_msg', models.TextField(verbose_name='Desktop Message')),
                ('net_seq', models.IntegerField(default=0, verbose_name='Network Sequence')),
                ('net_msg', models.TextField(verbose_name='Network Message')),
                ('fac_seq', models.IntegerField(default=0, verbose_name='Facilities Sequence')),
                ('fac_msg', models.TextField(verbose_name='Facilities Message')),
            ],
        ),
        migrations.AddField(
            model_name='ticket',
            name='ticket_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mac_app.TicketType'),
        ),
    ]
