# Generated by Django 3.1 on 2020-10-06 10:19

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='AuthUser',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128)),
                ('last_login', models.DateTimeField(blank=True, null=True)),
                ('is_superuser', models.IntegerField()),
                ('username', models.CharField(max_length=150, unique=True)),
                ('first_name', models.CharField(max_length=150)),
                ('last_name', models.CharField(max_length=150)),
                ('email', models.CharField(max_length=254)),
                ('is_staff', models.IntegerField()),
                ('is_active', models.IntegerField()),
                ('date_joined', models.DateTimeField()),
            ],
            options={
                'db_table': 'auth_user',
                'managed': False,
            },
        ),
        migrations.CreateModel(
            name='Client',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('client_name', models.CharField(default='', max_length=255)),
                ('project_number', models.CharField(default='', max_length=255)),
            ],
            options={
                'db_table': 'tblclient',
                'ordering': ('client_name',),
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Kind',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('kind', models.CharField(default='', max_length=20)),
                ('active', models.BooleanField()),
            ],
            options={
                'verbose_name_plural': 'Kind',
                'db_table': 'tbltaskkind',
                'ordering': ('kind',),
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Status',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('status', models.CharField(default='', max_length=20)),
            ],
            options={
                'verbose_name_plural': 'Status',
                'db_table': 'tbltaskstatus',
                'ordering': ('status',),
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Task',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('startdate', models.DateTimeField(blank=True, null=True)),
                ('duedate', models.DateTimeField()),
                ('invoiced', models.DateTimeField(blank=True, null=True)),
                ('client', models.ForeignKey(default=1, on_delete=django.db.models.deletion.RESTRICT, to='hrcompass.client')),
                ('kind', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.RESTRICT, to='hrcompass.kind')),
            ],
            options={
                'db_table': 'tbltask',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Taskuser',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('task', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hrcompass.task')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.RESTRICT, to='hrcompass.authuser')),
            ],
            options={
                'db_table': 'tbltaskuser',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Taskname',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(default='', max_length=4000)),
                ('task_kind', models.ForeignKey(default=1, on_delete=django.db.models.deletion.RESTRICT, to='hrcompass.kind')),
            ],
            options={
                'verbose_name_plural': 'Task Name',
                'db_table': 'tbltaskname',
                'ordering': ('name',),
                'managed': True,
            },
        ),
        migrations.AddField(
            model_name='task',
            name='members',
            field=models.ManyToManyField(related_name='tasks', through='hrcompass.Taskuser', to='hrcompass.AuthUser'),
        ),
        migrations.AddField(
            model_name='task',
            name='task_name',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.RESTRICT, to='hrcompass.taskname'),
        ),
        migrations.AddField(
            model_name='task',
            name='task_status',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.RESTRICT, to='hrcompass.status'),
        ),
        migrations.CreateModel(
            name='Clientuser',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('client', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hrcompass.client')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.RESTRICT, to='hrcompass.authuser')),
            ],
            options={
                'db_table': 'tblclientuser',
                'managed': True,
            },
        ),
        migrations.AddField(
            model_name='client',
            name='consultants',
            field=models.ManyToManyField(related_name='clients', through='hrcompass.Clientuser', to='hrcompass.AuthUser'),
        ),
    ]
