# Generated by Django 2.2.7 on 2019-11-07 06:07

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('comp', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Currency',
            fields=[
                ('currency_id', models.CharField(max_length=3, primary_key=True, serialize=False)),
                ('currency_name', models.CharField(max_length=30)),
            ],
        ),
        migrations.CreateModel(
            name='DaysOfWeek',
            fields=[
                ('daysofweek_id', models.CharField(max_length=1, primary_key=True, serialize=False)),
                ('dayname', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Employee',
            fields=[
                ('cif', models.CharField(max_length=8, primary_key=True, serialize=False)),
                ('fullname', models.TextField()),
                ('birthday', models.DateTimeField()),
            ],
        ),
        migrations.CreateModel(
            name='Gender',
            fields=[
                ('gender_id', models.CharField(max_length=1, primary_key=True, serialize=False)),
                ('gender_name', models.CharField(max_length=20)),
            ],
        ),
        migrations.CreateModel(
            name='IdName',
            fields=[
                ('id_name_code', models.CharField(max_length=4, primary_key=True, serialize=False)),
                ('name_of_identification', models.CharField(max_length=250)),
            ],
        ),
        migrations.CreateModel(
            name='Insurance',
            fields=[
                ('insurance_id', models.AutoField(primary_key=True, serialize=False)),
                ('social_company', models.FloatField()),
                ('social_tnld_bnn', models.FloatField()),
                ('social_employee', models.FloatField()),
                ('health_company', models.FloatField()),
                ('health_employee', models.FloatField()),
                ('unemployment_company', models.FloatField()),
                ('unemployment_employee', models.FloatField()),
                ('startday', models.DateTimeField()),
                ('endday', models.DateTimeField()),
                ('designation', models.TextField(null=True)),
            ],
        ),
        migrations.CreateModel(
            name='LaborContract',
            fields=[
                ('contract_id', models.AutoField(primary_key=True, serialize=False)),
                ('contract_number', models.CharField(max_length=30)),
                ('salary_benefit', models.FloatField()),
                ('contract_day', models.DateTimeField()),
                ('startday', models.DateTimeField()),
                ('endday', models.DateTimeField()),
                ('maturity_date', models.DateTimeField()),
                ('term', models.TextField()),
                ('cif', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hrms.Employee')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='comp.Company')),
                ('dept', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='comp.SubDepartment')),
                ('insurance', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hrms.Insurance')),
            ],
        ),
        migrations.CreateModel(
            name='Nation',
            fields=[
                ('nation_id', models.CharField(max_length=3, primary_key=True, serialize=False)),
                ('nation_name', models.CharField(max_length=250)),
            ],
        ),
        migrations.CreateModel(
            name='People',
            fields=[
                ('people_id', models.AutoField(primary_key=True, serialize=False)),
                ('people_name', models.CharField(max_length=250)),
            ],
        ),
        migrations.CreateModel(
            name='PlaceOfIdentification',
            fields=[
                ('place_id', models.CharField(max_length=4, primary_key=True, serialize=False)),
                ('place_of_identification', models.CharField(max_length=250)),
            ],
        ),
        migrations.CreateModel(
            name='SalaryBasicPlus',
            fields=[
                ('salary_basic_plus_id', models.AutoField(primary_key=True, serialize=False)),
                ('ratio', models.FloatField()),
                ('startday', models.DateTimeField()),
                ('endday', models.DateTimeField()),
            ],
        ),
        migrations.CreateModel(
            name='SalaryScale',
            fields=[
                ('scale_id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=3)),
                ('scale', models.FloatField(default=0)),
                ('startday', models.DateTimeField()),
                ('endday', models.DateTimeField()),
            ],
        ),
        migrations.CreateModel(
            name='Union',
            fields=[
                ('union_id', models.AutoField(primary_key=True, serialize=False)),
                ('ratio_company', models.FloatField()),
                ('ratio_employee', models.FloatField()),
                ('startday', models.DateTimeField()),
                ('endday', models.DateTimeField()),
                ('designation', models.TextField(null=True)),
            ],
        ),
        migrations.CreateModel(
            name='WorkingGroup',
            fields=[
                ('workinggroup_id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='WorkingTime',
            fields=[
                ('workingtime_id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=100)),
                ('starttime', models.TimeField(null=True)),
                ('endtime', models.TimeField(null=True)),
                ('description', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='WorkSchedules',
            fields=[
                ('workschedules_id', models.AutoField(primary_key=True, serialize=False)),
                ('daysofweek', models.ManyToManyField(to='hrms.DaysOfWeek')),
                ('workinggroup', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hrms.WorkingGroup')),
                ('workingtime', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hrms.WorkingTime')),
            ],
        ),
        migrations.CreateModel(
            name='SalaryBasic',
            fields=[
                ('salary_basic_id', models.AutoField(primary_key=True, serialize=False)),
                ('amount', models.FloatField()),
                ('startday', models.DateTimeField()),
                ('endday', models.DateTimeField()),
                ('designation', models.TextField(null=True)),
                ('currency', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hrms.Currency')),
            ],
        ),
        migrations.CreateModel(
            name='Salary',
            fields=[
                ('salary_id', models.AutoField(primary_key=True, serialize=False)),
                ('salary_date', models.DateTimeField()),
                ('salary_other', models.FloatField()),
                ('salary_advance', models.FloatField()),
                ('days_working', models.FloatField()),
                ('days_unpaid_leave', models.FloatField()),
                ('days_paid_leave', models.FloatField()),
                ('days_annual_leave', models.FloatField()),
                ('bonus', models.FloatField()),
                ('kpi_point', models.FloatField()),
                ('overtime', models.FloatField()),
                ('tax_abatement', models.FloatField(null=True)),
                ('cif', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hrms.Employee')),
                ('contract', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hrms.LaborContract')),
            ],
        ),
        migrations.CreateModel(
            name='MealMoney',
            fields=[
                ('mealmoney_id', models.AutoField(primary_key=True, serialize=False)),
                ('amount', models.FloatField()),
                ('startday', models.DateTimeField()),
                ('endday', models.DateTimeField()),
                ('currency', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hrms.Currency')),
            ],
        ),
        migrations.AddField(
            model_name='laborcontract',
            name='mealmoney',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hrms.MealMoney'),
        ),
        migrations.AddField(
            model_name='laborcontract',
            name='salary_basic',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hrms.SalaryBasic'),
        ),
        migrations.AddField(
            model_name='laborcontract',
            name='scale',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hrms.SalaryScale'),
        ),
        migrations.AddField(
            model_name='laborcontract',
            name='subdept',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='comp.Department'),
        ),
        migrations.AddField(
            model_name='laborcontract',
            name='union',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hrms.Union'),
        ),
        migrations.AddField(
            model_name='laborcontract',
            name='workinggroup',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hrms.WorkingGroup'),
        ),
        migrations.CreateModel(
            name='IdentityDocument',
            fields=[
                ('id_code', models.IntegerField(primary_key=True, serialize=False)),
                ('id', models.CharField(max_length=20)),
                ('startday', models.DateTimeField()),
                ('endday', models.DateTimeField()),
                ('cif', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hrms.Employee')),
                ('id_name_code', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hrms.IdName')),
                ('nation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hrms.Nation')),
                ('people', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hrms.People')),
                ('place', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hrms.PlaceOfIdentification')),
            ],
        ),
        migrations.CreateModel(
            name='EmployeePosition',
            fields=[
                ('emp_position_id', models.AutoField(primary_key=True, serialize=False)),
                ('position_index', models.IntegerField(null=True)),
                ('startday', models.DateTimeField()),
                ('endday', models.DateTimeField()),
                ('cif', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hrms.Employee')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='comp.Company')),
                ('dept', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='comp.Department')),
                ('position', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='comp.Positions')),
                ('subdept', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='comp.SubDepartment')),
            ],
        ),
        migrations.AddField(
            model_name='employee',
            name='gender',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hrms.Gender'),
        ),
        migrations.CreateModel(
            name='EmployeePhone',
            fields=[
                ('phone_number_id', models.AutoField(primary_key=True, serialize=False)),
                ('phone_number', models.CharField(max_length=20)),
                ('phone_number_index', models.IntegerField()),
                ('cif', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hrms.Employee')),
            ],
            options={
                'unique_together': {('cif', 'phone_number_id')},
            },
        ),
        migrations.CreateModel(
            name='EmployeeEmail',
            fields=[
                ('email_id', models.AutoField(primary_key=True, serialize=False)),
                ('email', models.CharField(max_length=50)),
                ('email_index', models.IntegerField()),
                ('cif', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hrms.Employee')),
            ],
            options={
                'unique_together': {('cif', 'email_id')},
            },
        ),
        migrations.CreateModel(
            name='EmployeeBankAccount',
            fields=[
                ('bank_account_id', models.AutoField(primary_key=True, serialize=False)),
                ('account_number', models.CharField(max_length=20)),
                ('bank_name', models.TextField()),
                ('bank_address', models.TextField()),
                ('account_number_index', models.IntegerField()),
                ('cif', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hrms.Employee')),
            ],
            options={
                'unique_together': {('cif', 'bank_account_id')},
            },
        ),
        migrations.CreateModel(
            name='EmployeeAddress',
            fields=[
                ('address_id', models.AutoField(primary_key=True, serialize=False)),
                ('address', models.TextField()),
                ('startday', models.DateTimeField()),
                ('endday', models.DateTimeField()),
                ('address_index', models.IntegerField()),
                ('cif', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hrms.Employee')),
            ],
            options={
                'unique_together': {('cif', 'address_id')},
            },
        ),
    ]
