# Generated by Django 3.2.4 on 2021-08-06 19:37

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Company',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('country', models.CharField(max_length=90)),
                ('address', models.CharField(max_length=255)),
                ('start_working_hour', models.TimeField(blank=True, null=True)),
                ('end_working_hour', models.TimeField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Division',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('level', models.IntegerField(default=0)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='FK_Division_Company', to='mainapps.company')),
            ],
        ),
        migrations.CreateModel(
            name='EmployeePayType',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Position',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('level', models.IntegerField(default=0)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='FK_Position_Company', to='mainapps.company')),
                ('division', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='FK_Position_Division', to='mainapps.division')),
            ],
        ),
        migrations.CreateModel(
            name='Message',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('message', models.TextField()),
                ('timestamp', models.DateTimeField(blank=True, default=datetime.datetime.now)),
                ('from_user', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, related_name='FK_Message_from_user', to=settings.AUTH_USER_MODEL)),
                ('to_user', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, related_name='FK_Message_to_user', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Feed',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('message', models.TextField()),
                ('timestamp', models.DateTimeField(blank=True, default=datetime.datetime.now)),
                ('company', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='FK_Feed_Company', to='mainapps.company')),
            ],
        ),
        migrations.CreateModel(
            name='EmployeeType',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='FK_EmployeeType_Company', to='mainapps.company')),
            ],
        ),
        migrations.CreateModel(
            name='Employee',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('pay_rate', models.IntegerField(default=0)),
                ('company', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='FK_Employee_Company', to='mainapps.company')),
                ('pay_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='FK_Employee_EmployeePayType', to='mainapps.employeepaytype')),
                ('position', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='FK_Employee_position', to='mainapps.position')),
                ('type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='FK_Employee_EmployeeType', to='mainapps.employeetype')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, related_name='FK_Employee_user', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='AttendaceCode',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('secret_key', models.TextField()),
                ('company', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='FK_AttendaceCode_Company', to='mainapps.company')),
            ],
        ),
        migrations.CreateModel(
            name='Attandance',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField(auto_now_add=True)),
                ('status', models.CharField(max_length=15)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, related_name='FK_Attandance_user', to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
